├── .github └── FUNDING.yml ├── .gitignore ├── Assets ├── FancyScrollView.meta └── FancyScrollView │ ├── Examples.meta │ ├── Examples │ ├── 01_Basic.unity │ ├── 01_Basic.unity.meta │ ├── 02_FocusOn.unity │ ├── 02_FocusOn.unity.meta │ ├── 03_InfiniteScroll.unity │ ├── 03_InfiniteScroll.unity.meta │ ├── 04_Metaball.unity │ ├── 04_Metaball.unity.meta │ ├── 05_Voronoi.unity │ ├── 05_Voronoi.unity.meta │ ├── 06_LoopTabBar.unity │ ├── 06_LoopTabBar.unity.meta │ ├── 07_ScrollRect.unity │ ├── 07_ScrollRect.unity.meta │ ├── 08_GridView.unity │ ├── 08_GridView.unity.meta │ ├── 09_LoadTexture.unity │ ├── 09_LoadTexture.unity.meta │ ├── Sources.meta │ └── Sources │ │ ├── 01_Basic.meta │ │ ├── 01_Basic │ │ ├── Cell.cs │ │ ├── Cell.cs.meta │ │ ├── Cell.prefab │ │ ├── Cell.prefab.meta │ │ ├── CellScroll.anim │ │ ├── CellScroll.anim.meta │ │ ├── CellScroll.controller │ │ ├── CellScroll.controller.meta │ │ ├── Example01.cs │ │ ├── Example01.cs.meta │ │ ├── ItemData.cs │ │ ├── ItemData.cs.meta │ │ ├── ScrollView.cs │ │ └── ScrollView.cs.meta │ │ ├── 02_FocusOn.meta │ │ ├── 02_FocusOn │ │ ├── Cell.cs │ │ ├── Cell.cs.meta │ │ ├── Cell.prefab │ │ ├── Cell.prefab.meta │ │ ├── CellScroll.anim │ │ ├── CellScroll.anim.meta │ │ ├── CellScroll.controller │ │ ├── CellScroll.controller.meta │ │ ├── Context.cs │ │ ├── Context.cs.meta │ │ ├── Example02.cs │ │ ├── Example02.cs.meta │ │ ├── ItemData.cs │ │ ├── ItemData.cs.meta │ │ ├── ScrollView.cs │ │ └── ScrollView.cs.meta │ │ ├── 03_InfiniteScroll.meta │ │ ├── 03_InfiniteScroll │ │ ├── Cell.cs │ │ ├── Cell.cs.meta │ │ ├── Cell.prefab │ │ ├── Cell.prefab.meta │ │ ├── CellScroll.anim │ │ ├── CellScroll.anim.meta │ │ ├── CellScroll.controller │ │ ├── CellScroll.controller.meta │ │ ├── Context.cs │ │ ├── Context.cs.meta │ │ ├── Example03.cs │ │ ├── Example03.cs.meta │ │ ├── ItemData.cs │ │ ├── ItemData.cs.meta │ │ ├── ScrollView.cs │ │ └── ScrollView.cs.meta │ │ ├── 04_Metaball.meta │ │ ├── 04_Metaball │ │ ├── Background.cs │ │ ├── Background.cs.meta │ │ ├── Cell.cs │ │ ├── Cell.cs.meta │ │ ├── Cell.prefab │ │ ├── Cell.prefab.meta │ │ ├── CellScroll.anim │ │ ├── CellScroll.anim.meta │ │ ├── CellScroll.controller │ │ ├── CellScroll.controller.meta │ │ ├── Context.cs │ │ ├── Context.cs.meta │ │ ├── Example04.cs │ │ ├── Example04.cs.meta │ │ ├── ItemData.cs │ │ ├── ItemData.cs.meta │ │ ├── Metaball.hlsl │ │ ├── Metaball.hlsl.meta │ │ ├── Metaball.mat │ │ ├── Metaball.mat.meta │ │ ├── Metaball.shader │ │ ├── Metaball.shader.meta │ │ ├── ScrollView.cs │ │ └── ScrollView.cs.meta │ │ ├── 05_Voronoi.meta │ │ ├── 05_Voronoi │ │ ├── Background.cs │ │ ├── Background.cs.meta │ │ ├── Cell.cs │ │ ├── Cell.cs.meta │ │ ├── Cell.prefab │ │ ├── Cell.prefab.meta │ │ ├── CellScroll.anim │ │ ├── CellScroll.anim.meta │ │ ├── CellScroll.controller │ │ ├── CellScroll.controller.meta │ │ ├── Context.cs │ │ ├── Context.cs.meta │ │ ├── Example05.cs │ │ ├── Example05.cs.meta │ │ ├── ItemData.cs │ │ ├── ItemData.cs.meta │ │ ├── ScrollView.cs │ │ ├── ScrollView.cs.meta │ │ ├── Voronoi.hlsl │ │ ├── Voronoi.hlsl.meta │ │ ├── Voronoi.mat │ │ ├── Voronoi.mat.meta │ │ ├── Voronoi.shader │ │ └── Voronoi.shader.meta │ │ ├── 06_LoopTabBar.meta │ │ ├── 06_LoopTabBar │ │ ├── Context.cs │ │ ├── Context.cs.meta │ │ ├── Example06.cs │ │ ├── Example06.cs.meta │ │ ├── ItemData.cs │ │ ├── ItemData.cs.meta │ │ ├── ScrollView.cs │ │ ├── ScrollView.cs.meta │ │ ├── SlideScreenTransition.cs │ │ ├── SlideScreenTransition.cs.meta │ │ ├── Tab.anim │ │ ├── Tab.anim.meta │ │ ├── Tab.controller │ │ ├── Tab.controller.meta │ │ ├── Tab.cs │ │ ├── Tab.cs.meta │ │ ├── Tab.prefab │ │ ├── Tab.prefab.meta │ │ ├── Window.cs │ │ ├── Window.cs.meta │ │ ├── Window.prefab │ │ └── Window.prefab.meta │ │ ├── 07_ScrollRect.meta │ │ ├── 07_ScrollRect │ │ ├── Alignment.cs │ │ ├── Alignment.cs.meta │ │ ├── Cell.cs │ │ ├── Cell.cs.meta │ │ ├── Cell.prefab │ │ ├── Cell.prefab.meta │ │ ├── Context.cs │ │ ├── Context.cs.meta │ │ ├── Example07.cs │ │ ├── Example07.cs.meta │ │ ├── ItemData.cs │ │ ├── ItemData.cs.meta │ │ ├── ScrollView.cs │ │ └── ScrollView.cs.meta │ │ ├── 08_GridView.meta │ │ ├── 08_GridView │ │ ├── Alignment.cs │ │ ├── Alignment.cs.meta │ │ ├── Cell.cs │ │ ├── Cell.cs.meta │ │ ├── Cell.prefab │ │ ├── Cell.prefab.meta │ │ ├── Context.cs │ │ ├── Context.cs.meta │ │ ├── Example08.cs │ │ ├── Example08.cs.meta │ │ ├── GridView.cs │ │ ├── GridView.cs.meta │ │ ├── ItemData.cs │ │ └── ItemData.cs.meta │ │ ├── 09_LoadTexture.meta │ │ ├── 09_LoadTexture │ │ ├── Cell.cs │ │ ├── Cell.cs.meta │ │ ├── Cell.prefab │ │ ├── Cell.prefab.meta │ │ ├── Example09.cs │ │ ├── Example09.cs.meta │ │ ├── ItemData.cs │ │ ├── ItemData.cs.meta │ │ ├── ScrollView.cs │ │ ├── ScrollView.cs.meta │ │ ├── TextureLoader.cs │ │ └── TextureLoader.cs.meta │ │ ├── Common.meta │ │ └── Common │ │ ├── CellIn.anim │ │ ├── CellIn.anim.meta │ │ ├── CellOut.anim │ │ ├── CellOut.anim.meta │ │ ├── CellSelect.controller │ │ ├── CellSelect.controller.meta │ │ ├── Common.cginc │ │ ├── Common.cginc.meta │ │ ├── Dropdown.prefab │ │ ├── Dropdown.prefab.meta │ │ ├── ScenesDropdown.cs │ │ └── ScenesDropdown.cs.meta │ ├── Sources.meta │ └── Sources │ ├── Editor.meta │ ├── Editor │ ├── FancyScrollView.Editor.asmdef │ ├── FancyScrollView.Editor.asmdef.meta │ ├── ScrollerEditor.cs │ └── ScrollerEditor.cs.meta │ ├── Runtime.meta │ └── Runtime │ ├── Core.meta │ ├── Core │ ├── FancyCell.cs │ ├── FancyCell.cs.meta │ ├── FancyScrollView.cs │ └── FancyScrollView.cs.meta │ ├── FancyScrollView.asmdef │ ├── FancyScrollView.asmdef.meta │ ├── GridView.meta │ ├── GridView │ ├── FancyCellGroup.cs │ ├── FancyCellGroup.cs.meta │ ├── FancyGridView.cs │ ├── FancyGridView.cs.meta │ ├── FancyGridViewCell.cs │ ├── FancyGridViewCell.cs.meta │ ├── FancyGridViewContext.cs │ ├── FancyGridViewContext.cs.meta │ ├── IFancyCellGroupContext.cs │ ├── IFancyCellGroupContext.cs.meta │ ├── IFancyGridViewContext.cs │ └── IFancyGridViewContext.cs.meta │ ├── ScrollRect.meta │ ├── ScrollRect │ ├── FancyScrollRect.cs │ ├── FancyScrollRect.cs.meta │ ├── FancyScrollRectCell.cs │ ├── FancyScrollRectCell.cs.meta │ ├── FancyScrollRectContext.cs │ ├── FancyScrollRectContext.cs.meta │ ├── IFancyScrollRectContext.cs │ └── IFancyScrollRectContext.cs.meta │ ├── Scroller.meta │ └── Scroller │ ├── EasingCore.cs │ ├── EasingCore.cs.meta │ ├── MovementDirection.cs │ ├── MovementDirection.cs.meta │ ├── MovementType.cs │ ├── MovementType.cs.meta │ ├── ScrollDirection.cs │ ├── ScrollDirection.cs.meta │ ├── Scroller.cs │ └── Scroller.cs.meta ├── LICENSE ├── 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 └── README.md /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: setchi 4 | ko_fi: setchi 5 | patreon: setchi 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | [Ll]ibrary/ 2 | [Tt]emp/ 3 | [Oo]bj/ 4 | [Bb]uild/ 5 | [Bb]uilds/ 6 | [Ll]ogs/ 7 | Assets/AssetStoreTools* 8 | 9 | # Windows 10 | Thumbs.db 11 | Desktop.ini 12 | 13 | # macOS 14 | .DS_Store 15 | 16 | # Uncomment this line if you wish to ignore the asset store tools plugin 17 | # [Aa]ssets/AssetStoreTools* 18 | 19 | # TextMesh Pro files 20 | [Aa]ssets/TextMesh*Pro/ 21 | 22 | # Visual Studio cache directory 23 | .vs/ 24 | .vscode/ 25 | 26 | # Gradle cache directory 27 | .gradle/ 28 | 29 | # Autogenerated VS/MD/Consulo solution and project files 30 | ExportedObj/ 31 | .consulo/ 32 | *.csproj 33 | *.unityproj 34 | *.sln 35 | *.suo 36 | *.tmp 37 | *.user 38 | *.userprefs 39 | *.pidb 40 | *.booproj 41 | *.svd 42 | *.pdb 43 | *.mdb 44 | *.opendb 45 | *.VC.db 46 | 47 | # Unity3D generated meta files 48 | *.pidb.meta 49 | *.pdb.meta 50 | *.mdb.meta 51 | 52 | # Unity3D generated file on crash reports 53 | sysinfo.txt 54 | 55 | # Builds 56 | *.apk 57 | *.unitypackage 58 | 59 | # Crashlytics generated file 60 | crashlytics-build.properties 61 | -------------------------------------------------------------------------------- /Assets/FancyScrollView.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9fc575374ede1934aaca39f1d169e0d4 3 | folderAsset: yes 4 | timeCreated: 1487434866 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d5937a2dff7ba594abe6c1b12bfbd7b2 3 | folderAsset: yes 4 | timeCreated: 1487183285 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/01_Basic.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f5666b6c719a9b544ab322e1066aef5f 3 | timeCreated: 1487186707 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/02_FocusOn.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ff644be2cb161904ba6ec037baf31ad1 3 | timeCreated: 1487505810 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/03_InfiniteScroll.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 22d1be941599faf45b04ab4c6a2def09 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/04_Metaball.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4f0f25a90e2674f75a24f6ea541c0a6c 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/05_Voronoi.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9f4081131e0754ae184f905e3d995a98 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/06_LoopTabBar.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 58528ac4d9c36415ea90597e1199f2e4 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/07_ScrollRect.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8d95738372cdc4d858b4c4c4f06d2db1 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/08_GridView.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8441a013bef6d450aa8dc5de6207a233 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/09_LoadTexture.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: eb8cb776d6776468eb0bec979e0c2010 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 411d74237da48401ab1e38e01a92fd6d 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/01_Basic.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f3cfbf59a232f094ebabafd65418564f 3 | folderAsset: yes 4 | timeCreated: 1487433971 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/01_Basic/Cell.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * FancyScrollView (https://github.com/setchi/FancyScrollView) 3 | * Copyright (c) 2020 setchi 4 | * Licensed under MIT (https://github.com/setchi/FancyScrollView/blob/master/LICENSE) 5 | */ 6 | 7 | using UnityEngine; 8 | using UnityEngine.UI; 9 | 10 | namespace FancyScrollView.Example01 11 | { 12 | class Cell : FancyCell 13 | { 14 | [SerializeField] Animator animator = default; 15 | [SerializeField] Text message = default; 16 | 17 | static class AnimatorHash 18 | { 19 | public static readonly int Scroll = Animator.StringToHash("scroll"); 20 | } 21 | 22 | public override void UpdateContent(ItemData itemData) 23 | { 24 | message.text = itemData.Message; 25 | } 26 | 27 | public override void UpdatePosition(float position) 28 | { 29 | currentPosition = position; 30 | 31 | if (animator.isActiveAndEnabled) 32 | { 33 | animator.Play(AnimatorHash.Scroll, -1, position); 34 | } 35 | 36 | animator.speed = 0; 37 | } 38 | 39 | // GameObject が非アクティブになると Animator がリセットされてしまうため 40 | // 現在位置を保持しておいて OnEnable のタイミングで現在位置を再設定します 41 | float currentPosition = 0; 42 | 43 | void OnEnable() => UpdatePosition(currentPosition); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/01_Basic/Cell.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b77a04c729f174c478baf21a47c16620 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/01_Basic/Cell.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b211dcb1c69c24ebdb530112c34a0e4d 3 | timeCreated: 1508240682 4 | licenseType: Free 5 | NativeFormatImporter: 6 | externalObjects: {} 7 | mainObjectFileID: 100100000 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/01_Basic/CellScroll.anim.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9e6e4c5500df9dc439749ba892b2995c 3 | timeCreated: 1487186596 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/01_Basic/CellScroll.controller: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!91 &9100000 4 | AnimatorController: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 0} 8 | m_Name: CellScroll 9 | serializedVersion: 5 10 | m_AnimatorParameters: 11 | - m_Name: scroll 12 | m_Type: 9 13 | m_DefaultFloat: 0 14 | m_DefaultInt: 0 15 | m_DefaultBool: 1 16 | m_Controller: {fileID: 9100000} 17 | m_AnimatorLayers: 18 | - serializedVersion: 5 19 | m_Name: Base Layer 20 | m_StateMachine: {fileID: 1107904440216339570} 21 | m_Mask: {fileID: 0} 22 | m_Motions: [] 23 | m_Behaviours: [] 24 | m_BlendingMode: 0 25 | m_SyncedLayerIndex: -1 26 | m_DefaultWeight: 0 27 | m_IKPass: 0 28 | m_SyncedLayerAffectsTiming: 0 29 | m_Controller: {fileID: 9100000} 30 | --- !u!1101 &1101181072344081740 31 | AnimatorStateTransition: 32 | m_ObjectHideFlags: 1 33 | m_PrefabParentObject: {fileID: 0} 34 | m_PrefabInternal: {fileID: 0} 35 | m_Name: 36 | m_Conditions: [] 37 | m_DstStateMachine: {fileID: 0} 38 | m_DstState: {fileID: 1102900943980948860} 39 | m_Solo: 0 40 | m_Mute: 0 41 | m_IsExit: 0 42 | serializedVersion: 3 43 | m_TransitionDuration: 0 44 | m_TransitionOffset: 0 45 | m_ExitTime: 0 46 | m_HasExitTime: 1 47 | m_HasFixedDuration: 1 48 | m_InterruptionSource: 0 49 | m_OrderedInterruption: 1 50 | m_CanTransitionToSelf: 1 51 | --- !u!1102 &1102900943980948860 52 | AnimatorState: 53 | serializedVersion: 5 54 | m_ObjectHideFlags: 1 55 | m_PrefabParentObject: {fileID: 0} 56 | m_PrefabInternal: {fileID: 0} 57 | m_Name: scroll 58 | m_Speed: 1 59 | m_CycleOffset: 0 60 | m_Transitions: [] 61 | m_StateMachineBehaviours: [] 62 | m_Position: {x: 50, y: 50, z: 0} 63 | m_IKOnFeet: 0 64 | m_WriteDefaultValues: 1 65 | m_Mirror: 0 66 | m_SpeedParameterActive: 0 67 | m_MirrorParameterActive: 0 68 | m_CycleOffsetParameterActive: 0 69 | m_Motion: {fileID: 7400000, guid: 9e6e4c5500df9dc439749ba892b2995c, type: 2} 70 | m_Tag: 71 | m_SpeedParameter: 72 | m_MirrorParameter: 73 | m_CycleOffsetParameter: 74 | --- !u!1107 &1107904440216339570 75 | AnimatorStateMachine: 76 | serializedVersion: 5 77 | m_ObjectHideFlags: 1 78 | m_PrefabParentObject: {fileID: 0} 79 | m_PrefabInternal: {fileID: 0} 80 | m_Name: Base Layer 81 | m_ChildStates: 82 | - serializedVersion: 1 83 | m_State: {fileID: 1102900943980948860} 84 | m_Position: {x: 252, y: 24, z: 0} 85 | m_ChildStateMachines: [] 86 | m_AnyStateTransitions: 87 | - {fileID: 1101181072344081740} 88 | m_EntryTransitions: [] 89 | m_StateMachineTransitions: {} 90 | m_StateMachineBehaviours: [] 91 | m_AnyStatePosition: {x: 50, y: 20, z: 0} 92 | m_EntryPosition: {x: 50, y: 120, z: 0} 93 | m_ExitPosition: {x: 800, y: 120, z: 0} 94 | m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} 95 | m_DefaultState: {fileID: 1102900943980948860} 96 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/01_Basic/CellScroll.controller.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8bbdb068c73989c438aef167096a86cb 3 | timeCreated: 1487186612 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/01_Basic/Example01.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * FancyScrollView (https://github.com/setchi/FancyScrollView) 3 | * Copyright (c) 2020 setchi 4 | * Licensed under MIT (https://github.com/setchi/FancyScrollView/blob/master/LICENSE) 5 | */ 6 | 7 | using System.Linq; 8 | using UnityEngine; 9 | 10 | namespace FancyScrollView.Example01 11 | { 12 | class Example01 : MonoBehaviour 13 | { 14 | [SerializeField] ScrollView scrollView = default; 15 | 16 | void Start() 17 | { 18 | var items = Enumerable.Range(0, 20) 19 | .Select(i => new ItemData($"Cell {i}")) 20 | .ToArray(); 21 | 22 | scrollView.UpdateData(items); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/01_Basic/Example01.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 69123a589054bf041ba5ead99364646f 3 | timeCreated: 1487186233 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/01_Basic/ItemData.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * FancyScrollView (https://github.com/setchi/FancyScrollView) 3 | * Copyright (c) 2020 setchi 4 | * Licensed under MIT (https://github.com/setchi/FancyScrollView/blob/master/LICENSE) 5 | */ 6 | 7 | namespace FancyScrollView.Example01 8 | { 9 | class ItemData 10 | { 11 | public string Message { get; } 12 | 13 | public ItemData(string message) 14 | { 15 | Message = message; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/01_Basic/ItemData.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fe195dccef0874cf9b6f90eb82e8bb4d 3 | timeCreated: 1552490564 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/01_Basic/ScrollView.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * FancyScrollView (https://github.com/setchi/FancyScrollView) 3 | * Copyright (c) 2020 setchi 4 | * Licensed under MIT (https://github.com/setchi/FancyScrollView/blob/master/LICENSE) 5 | */ 6 | 7 | using UnityEngine; 8 | using System.Collections.Generic; 9 | 10 | namespace FancyScrollView.Example01 11 | { 12 | class ScrollView : FancyScrollView 13 | { 14 | [SerializeField] Scroller scroller = default; 15 | [SerializeField] GameObject cellPrefab = default; 16 | 17 | protected override GameObject CellPrefab => cellPrefab; 18 | 19 | protected override void Initialize() 20 | { 21 | base.Initialize(); 22 | scroller.OnValueChanged(UpdatePosition); 23 | } 24 | 25 | public void UpdateData(IList items) 26 | { 27 | UpdateContents(items); 28 | scroller.SetTotalCount(items.Count); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/01_Basic/ScrollView.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c7e0222f92bdad84c9ee57a127efe088 3 | timeCreated: 1487262733 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/02_FocusOn.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 729b94de0a7f5104d9fc008e52c10f6d 3 | folderAsset: yes 4 | timeCreated: 1487433984 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/02_FocusOn/Cell.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * FancyScrollView (https://github.com/setchi/FancyScrollView) 3 | * Copyright (c) 2020 setchi 4 | * Licensed under MIT (https://github.com/setchi/FancyScrollView/blob/master/LICENSE) 5 | */ 6 | 7 | using UnityEngine; 8 | using UnityEngine.UI; 9 | 10 | namespace FancyScrollView.Example02 11 | { 12 | class Cell : FancyCell 13 | { 14 | [SerializeField] Animator animator = default; 15 | [SerializeField] Text message = default; 16 | [SerializeField] Image image = default; 17 | [SerializeField] Button button = default; 18 | 19 | static class AnimatorHash 20 | { 21 | public static readonly int Scroll = Animator.StringToHash("scroll"); 22 | } 23 | 24 | public override void Initialize() 25 | { 26 | button.onClick.AddListener(() => Context.OnCellClicked?.Invoke(Index)); 27 | } 28 | 29 | public override void UpdateContent(ItemData itemData) 30 | { 31 | message.text = itemData.Message; 32 | 33 | var selected = Context.SelectedIndex == Index; 34 | image.color = selected 35 | ? new Color32(0, 255, 255, 100) 36 | : new Color32(255, 255, 255, 77); 37 | } 38 | 39 | public override void UpdatePosition(float position) 40 | { 41 | currentPosition = position; 42 | 43 | if (animator.isActiveAndEnabled) 44 | { 45 | animator.Play(AnimatorHash.Scroll, -1, position); 46 | } 47 | 48 | animator.speed = 0; 49 | } 50 | 51 | // GameObject が非アクティブになると Animator がリセットされてしまうため 52 | // 現在位置を保持しておいて OnEnable のタイミングで現在位置を再設定します 53 | float currentPosition = 0; 54 | 55 | void OnEnable() => UpdatePosition(currentPosition); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/02_FocusOn/Cell.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 08f1e4cba8817f34ba916b510b19d736 3 | timeCreated: 1487505842 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/02_FocusOn/Cell.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d432cd8a052c847b0a9234295575210d 3 | timeCreated: 1508240603 4 | licenseType: Free 5 | NativeFormatImporter: 6 | externalObjects: {} 7 | mainObjectFileID: 100100000 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/02_FocusOn/CellScroll.anim.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 96960e4e54d07421782f0cf12f901ecb 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/02_FocusOn/CellScroll.controller: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!91 &9100000 4 | AnimatorController: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_Name: CellScroll 10 | serializedVersion: 5 11 | m_AnimatorParameters: 12 | - m_Name: scroll 13 | m_Type: 9 14 | m_DefaultFloat: 0 15 | m_DefaultInt: 0 16 | m_DefaultBool: 1 17 | m_Controller: {fileID: 9100000} 18 | m_AnimatorLayers: 19 | - serializedVersion: 5 20 | m_Name: Base Layer 21 | m_StateMachine: {fileID: 1107904440216339570} 22 | m_Mask: {fileID: 0} 23 | m_Motions: [] 24 | m_Behaviours: [] 25 | m_BlendingMode: 0 26 | m_SyncedLayerIndex: -1 27 | m_DefaultWeight: 0 28 | m_IKPass: 0 29 | m_SyncedLayerAffectsTiming: 0 30 | m_Controller: {fileID: 9100000} 31 | --- !u!1101 &1101181072344081740 32 | AnimatorStateTransition: 33 | m_ObjectHideFlags: 1 34 | m_CorrespondingSourceObject: {fileID: 0} 35 | m_PrefabInstance: {fileID: 0} 36 | m_PrefabAsset: {fileID: 0} 37 | m_Name: 38 | m_Conditions: [] 39 | m_DstStateMachine: {fileID: 0} 40 | m_DstState: {fileID: 1102900943980948860} 41 | m_Solo: 0 42 | m_Mute: 0 43 | m_IsExit: 0 44 | serializedVersion: 3 45 | m_TransitionDuration: 0 46 | m_TransitionOffset: 0 47 | m_ExitTime: 0 48 | m_HasExitTime: 1 49 | m_HasFixedDuration: 1 50 | m_InterruptionSource: 0 51 | m_OrderedInterruption: 1 52 | m_CanTransitionToSelf: 1 53 | --- !u!1102 &1102900943980948860 54 | AnimatorState: 55 | serializedVersion: 5 56 | m_ObjectHideFlags: 1 57 | m_CorrespondingSourceObject: {fileID: 0} 58 | m_PrefabInstance: {fileID: 0} 59 | m_PrefabAsset: {fileID: 0} 60 | m_Name: scroll 61 | m_Speed: 1 62 | m_CycleOffset: 0 63 | m_Transitions: [] 64 | m_StateMachineBehaviours: [] 65 | m_Position: {x: 50, y: 50, z: 0} 66 | m_IKOnFeet: 0 67 | m_WriteDefaultValues: 1 68 | m_Mirror: 0 69 | m_SpeedParameterActive: 0 70 | m_MirrorParameterActive: 0 71 | m_CycleOffsetParameterActive: 0 72 | m_TimeParameterActive: 0 73 | m_Motion: {fileID: 7400000, guid: 96960e4e54d07421782f0cf12f901ecb, type: 2} 74 | m_Tag: 75 | m_SpeedParameter: 76 | m_MirrorParameter: 77 | m_CycleOffsetParameter: 78 | m_TimeParameter: 79 | --- !u!1107 &1107904440216339570 80 | AnimatorStateMachine: 81 | serializedVersion: 5 82 | m_ObjectHideFlags: 1 83 | m_CorrespondingSourceObject: {fileID: 0} 84 | m_PrefabInstance: {fileID: 0} 85 | m_PrefabAsset: {fileID: 0} 86 | m_Name: Base Layer 87 | m_ChildStates: 88 | - serializedVersion: 1 89 | m_State: {fileID: 1102900943980948860} 90 | m_Position: {x: 252, y: 24, z: 0} 91 | m_ChildStateMachines: [] 92 | m_AnyStateTransitions: 93 | - {fileID: 1101181072344081740} 94 | m_EntryTransitions: [] 95 | m_StateMachineTransitions: {} 96 | m_StateMachineBehaviours: [] 97 | m_AnyStatePosition: {x: 50, y: 20, z: 0} 98 | m_EntryPosition: {x: 50, y: 120, z: 0} 99 | m_ExitPosition: {x: 800, y: 120, z: 0} 100 | m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} 101 | m_DefaultState: {fileID: 1102900943980948860} 102 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/02_FocusOn/CellScroll.controller.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8e2bedaf1264a430ea407addb93104f7 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/02_FocusOn/Context.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * FancyScrollView (https://github.com/setchi/FancyScrollView) 3 | * Copyright (c) 2020 setchi 4 | * Licensed under MIT (https://github.com/setchi/FancyScrollView/blob/master/LICENSE) 5 | */ 6 | 7 | using System; 8 | 9 | namespace FancyScrollView.Example02 10 | { 11 | class Context 12 | { 13 | public int SelectedIndex = -1; 14 | public Action OnCellClicked; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/02_FocusOn/Context.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1bc24697641338048b4ae874f1aac236 3 | timeCreated: 1487505870 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/02_FocusOn/Example02.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * FancyScrollView (https://github.com/setchi/FancyScrollView) 3 | * Copyright (c) 2020 setchi 4 | * Licensed under MIT (https://github.com/setchi/FancyScrollView/blob/master/LICENSE) 5 | */ 6 | 7 | using System.Linq; 8 | using UnityEngine; 9 | using UnityEngine.UI; 10 | 11 | namespace FancyScrollView.Example02 12 | { 13 | class Example02 : MonoBehaviour 14 | { 15 | [SerializeField] ScrollView scrollView = default; 16 | [SerializeField] Button prevCellButton = default; 17 | [SerializeField] Button nextCellButton = default; 18 | [SerializeField] Text selectedItemInfo = default; 19 | 20 | void Start() 21 | { 22 | prevCellButton.onClick.AddListener(scrollView.SelectPrevCell); 23 | nextCellButton.onClick.AddListener(scrollView.SelectNextCell); 24 | scrollView.OnSelectionChanged(OnSelectionChanged); 25 | 26 | var items = Enumerable.Range(0, 20) 27 | .Select(i => new ItemData($"Cell {i}")) 28 | .ToArray(); 29 | 30 | scrollView.UpdateData(items); 31 | scrollView.SelectCell(0); 32 | } 33 | 34 | void OnSelectionChanged(int index) 35 | { 36 | selectedItemInfo.text = $"Selected item info: index {index}"; 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/02_FocusOn/Example02.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ffef50039363c5244b22c9c6c6129c0a 3 | timeCreated: 1487506430 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/02_FocusOn/ItemData.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * FancyScrollView (https://github.com/setchi/FancyScrollView) 3 | * Copyright (c) 2020 setchi 4 | * Licensed under MIT (https://github.com/setchi/FancyScrollView/blob/master/LICENSE) 5 | */ 6 | 7 | namespace FancyScrollView.Example02 8 | { 9 | class ItemData 10 | { 11 | public string Message { get; } 12 | 13 | public ItemData(string message) 14 | { 15 | Message = message; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/02_FocusOn/ItemData.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 48174935593094cee83cdaa0b11eb8d7 3 | timeCreated: 1552490564 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/02_FocusOn/ScrollView.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * FancyScrollView (https://github.com/setchi/FancyScrollView) 3 | * Copyright (c) 2020 setchi 4 | * Licensed under MIT (https://github.com/setchi/FancyScrollView/blob/master/LICENSE) 5 | */ 6 | 7 | using System; 8 | using System.Collections.Generic; 9 | using UnityEngine; 10 | using EasingCore; 11 | 12 | namespace FancyScrollView.Example02 13 | { 14 | class ScrollView : FancyScrollView 15 | { 16 | [SerializeField] Scroller scroller = default; 17 | [SerializeField] GameObject cellPrefab = default; 18 | 19 | Action onSelectionChanged; 20 | 21 | protected override GameObject CellPrefab => cellPrefab; 22 | 23 | protected override void Initialize() 24 | { 25 | base.Initialize(); 26 | 27 | Context.OnCellClicked = SelectCell; 28 | 29 | scroller.OnValueChanged(UpdatePosition); 30 | scroller.OnSelectionChanged(UpdateSelection); 31 | } 32 | 33 | void UpdateSelection(int index) 34 | { 35 | if (Context.SelectedIndex == index) 36 | { 37 | return; 38 | } 39 | 40 | Context.SelectedIndex = index; 41 | Refresh(); 42 | 43 | onSelectionChanged?.Invoke(index); 44 | } 45 | 46 | public void UpdateData(IList items) 47 | { 48 | UpdateContents(items); 49 | scroller.SetTotalCount(items.Count); 50 | } 51 | 52 | public void OnSelectionChanged(Action callback) 53 | { 54 | onSelectionChanged = callback; 55 | } 56 | 57 | public void SelectNextCell() 58 | { 59 | SelectCell(Context.SelectedIndex + 1); 60 | } 61 | 62 | public void SelectPrevCell() 63 | { 64 | SelectCell(Context.SelectedIndex - 1); 65 | } 66 | 67 | public void SelectCell(int index) 68 | { 69 | if (index < 0 || index >= ItemsSource.Count || index == Context.SelectedIndex) 70 | { 71 | return; 72 | } 73 | 74 | UpdateSelection(index); 75 | scroller.ScrollTo(index, 0.35f, Ease.OutCubic); 76 | } 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/02_FocusOn/ScrollView.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 56f1da0ed0c4e244182dffa658d69315 3 | timeCreated: 1487505830 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/03_InfiniteScroll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 41e5d1e7f28ea1942a7e1f581484fbfe 3 | folderAsset: yes 4 | timeCreated: 1487433984 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/03_InfiniteScroll/Cell.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * FancyScrollView (https://github.com/setchi/FancyScrollView) 3 | * Copyright (c) 2020 setchi 4 | * Licensed under MIT (https://github.com/setchi/FancyScrollView/blob/master/LICENSE) 5 | */ 6 | 7 | using UnityEngine; 8 | using UnityEngine.UI; 9 | 10 | namespace FancyScrollView.Example03 11 | { 12 | class Cell : FancyCell 13 | { 14 | [SerializeField] Animator animator = default; 15 | [SerializeField] Text message = default; 16 | [SerializeField] Text messageLarge = default; 17 | [SerializeField] Image image = default; 18 | [SerializeField] Image imageLarge = default; 19 | [SerializeField] Button button = default; 20 | 21 | static class AnimatorHash 22 | { 23 | public static readonly int Scroll = Animator.StringToHash("scroll"); 24 | } 25 | 26 | void Start() 27 | { 28 | button.onClick.AddListener(() => Context.OnCellClicked?.Invoke(Index)); 29 | } 30 | 31 | public override void UpdateContent(ItemData itemData) 32 | { 33 | message.text = itemData.Message; 34 | messageLarge.text = Index.ToString(); 35 | 36 | var selected = Context.SelectedIndex == Index; 37 | imageLarge.color = image.color = selected 38 | ? new Color32(0, 255, 255, 100) 39 | : new Color32(255, 255, 255, 77); 40 | } 41 | 42 | public override void UpdatePosition(float position) 43 | { 44 | currentPosition = position; 45 | 46 | if (animator.isActiveAndEnabled) 47 | { 48 | animator.Play(AnimatorHash.Scroll, -1, position); 49 | } 50 | 51 | animator.speed = 0; 52 | } 53 | 54 | // GameObject が非アクティブになると Animator がリセットされてしまうため 55 | // 現在位置を保持しておいて OnEnable のタイミングで現在位置を再設定します 56 | float currentPosition = 0; 57 | 58 | void OnEnable() => UpdatePosition(currentPosition); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/03_InfiniteScroll/Cell.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9409f360a0deeb949a3635126edf8000 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/03_InfiniteScroll/Cell.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 34e1fd87ab6fa4ea9948dd561298519f 3 | timeCreated: 1508240666 4 | licenseType: Free 5 | NativeFormatImporter: 6 | externalObjects: {} 7 | mainObjectFileID: 100100000 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/03_InfiniteScroll/CellScroll.anim.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 42230555b1b5142f8bd7582c0e52d2db 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/03_InfiniteScroll/CellScroll.controller: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!91 &9100000 4 | AnimatorController: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_Name: CellScroll 10 | serializedVersion: 5 11 | m_AnimatorParameters: 12 | - m_Name: scroll 13 | m_Type: 9 14 | m_DefaultFloat: 0 15 | m_DefaultInt: 0 16 | m_DefaultBool: 1 17 | m_Controller: {fileID: 9100000} 18 | m_AnimatorLayers: 19 | - serializedVersion: 5 20 | m_Name: Base Layer 21 | m_StateMachine: {fileID: 1107904440216339570} 22 | m_Mask: {fileID: 0} 23 | m_Motions: [] 24 | m_Behaviours: [] 25 | m_BlendingMode: 0 26 | m_SyncedLayerIndex: -1 27 | m_DefaultWeight: 0 28 | m_IKPass: 0 29 | m_SyncedLayerAffectsTiming: 0 30 | m_Controller: {fileID: 9100000} 31 | --- !u!1101 &1101181072344081740 32 | AnimatorStateTransition: 33 | m_ObjectHideFlags: 1 34 | m_CorrespondingSourceObject: {fileID: 0} 35 | m_PrefabInstance: {fileID: 0} 36 | m_PrefabAsset: {fileID: 0} 37 | m_Name: 38 | m_Conditions: [] 39 | m_DstStateMachine: {fileID: 0} 40 | m_DstState: {fileID: 1102900943980948860} 41 | m_Solo: 0 42 | m_Mute: 0 43 | m_IsExit: 0 44 | serializedVersion: 3 45 | m_TransitionDuration: 0 46 | m_TransitionOffset: 0 47 | m_ExitTime: 0 48 | m_HasExitTime: 1 49 | m_HasFixedDuration: 1 50 | m_InterruptionSource: 0 51 | m_OrderedInterruption: 1 52 | m_CanTransitionToSelf: 1 53 | --- !u!1102 &1102900943980948860 54 | AnimatorState: 55 | serializedVersion: 5 56 | m_ObjectHideFlags: 1 57 | m_CorrespondingSourceObject: {fileID: 0} 58 | m_PrefabInstance: {fileID: 0} 59 | m_PrefabAsset: {fileID: 0} 60 | m_Name: scroll 61 | m_Speed: 1 62 | m_CycleOffset: 0 63 | m_Transitions: [] 64 | m_StateMachineBehaviours: [] 65 | m_Position: {x: 50, y: 50, z: 0} 66 | m_IKOnFeet: 0 67 | m_WriteDefaultValues: 1 68 | m_Mirror: 0 69 | m_SpeedParameterActive: 0 70 | m_MirrorParameterActive: 0 71 | m_CycleOffsetParameterActive: 0 72 | m_TimeParameterActive: 0 73 | m_Motion: {fileID: 7400000, guid: 42230555b1b5142f8bd7582c0e52d2db, type: 2} 74 | m_Tag: 75 | m_SpeedParameter: 76 | m_MirrorParameter: 77 | m_CycleOffsetParameter: 78 | m_TimeParameter: 79 | --- !u!1107 &1107904440216339570 80 | AnimatorStateMachine: 81 | serializedVersion: 5 82 | m_ObjectHideFlags: 1 83 | m_CorrespondingSourceObject: {fileID: 0} 84 | m_PrefabInstance: {fileID: 0} 85 | m_PrefabAsset: {fileID: 0} 86 | m_Name: Base Layer 87 | m_ChildStates: 88 | - serializedVersion: 1 89 | m_State: {fileID: 1102900943980948860} 90 | m_Position: {x: 252, y: 24, z: 0} 91 | m_ChildStateMachines: [] 92 | m_AnyStateTransitions: 93 | - {fileID: 1101181072344081740} 94 | m_EntryTransitions: [] 95 | m_StateMachineTransitions: {} 96 | m_StateMachineBehaviours: [] 97 | m_AnyStatePosition: {x: 50, y: 20, z: 0} 98 | m_EntryPosition: {x: 50, y: 120, z: 0} 99 | m_ExitPosition: {x: 800, y: 120, z: 0} 100 | m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} 101 | m_DefaultState: {fileID: 1102900943980948860} 102 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/03_InfiniteScroll/CellScroll.controller.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 980d16614f25c499e88c8b55a5caa63f 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/03_InfiniteScroll/Context.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * FancyScrollView (https://github.com/setchi/FancyScrollView) 3 | * Copyright (c) 2020 setchi 4 | * Licensed under MIT (https://github.com/setchi/FancyScrollView/blob/master/LICENSE) 5 | */ 6 | 7 | using System; 8 | 9 | namespace FancyScrollView.Example03 10 | { 11 | class Context 12 | { 13 | public int SelectedIndex = -1; 14 | public Action OnCellClicked; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/03_InfiniteScroll/Context.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 82429dd602c927c4faab5b80397e65a3 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/03_InfiniteScroll/Example03.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * FancyScrollView (https://github.com/setchi/FancyScrollView) 3 | * Copyright (c) 2020 setchi 4 | * Licensed under MIT (https://github.com/setchi/FancyScrollView/blob/master/LICENSE) 5 | */ 6 | 7 | using System.Linq; 8 | using UnityEngine; 9 | 10 | namespace FancyScrollView.Example03 11 | { 12 | class Example03 : MonoBehaviour 13 | { 14 | [SerializeField] ScrollView scrollView = default; 15 | 16 | void Start() 17 | { 18 | var items = Enumerable.Range(0, 20) 19 | .Select(i => new ItemData($"Cell {i}")) 20 | .ToArray(); 21 | 22 | scrollView.UpdateData(items); 23 | scrollView.SelectCell(0); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/03_InfiniteScroll/Example03.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 86f38031132bf4305b5a8388155d5a93 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/03_InfiniteScroll/ItemData.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * FancyScrollView (https://github.com/setchi/FancyScrollView) 3 | * Copyright (c) 2020 setchi 4 | * Licensed under MIT (https://github.com/setchi/FancyScrollView/blob/master/LICENSE) 5 | */ 6 | 7 | namespace FancyScrollView.Example03 8 | { 9 | class ItemData 10 | { 11 | public string Message { get; } 12 | 13 | public ItemData(string message) 14 | { 15 | Message = message; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/03_InfiniteScroll/ItemData.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 311ece1d289cc4f9090e43af0412d131 3 | timeCreated: 1552490564 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/03_InfiniteScroll/ScrollView.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * FancyScrollView (https://github.com/setchi/FancyScrollView) 3 | * Copyright (c) 2020 setchi 4 | * Licensed under MIT (https://github.com/setchi/FancyScrollView/blob/master/LICENSE) 5 | */ 6 | 7 | using System.Collections.Generic; 8 | using UnityEngine; 9 | using EasingCore; 10 | 11 | namespace FancyScrollView.Example03 12 | { 13 | class ScrollView : FancyScrollView 14 | { 15 | [SerializeField] Scroller scroller = default; 16 | [SerializeField] GameObject cellPrefab = default; 17 | 18 | protected override GameObject CellPrefab => cellPrefab; 19 | 20 | protected override void Initialize() 21 | { 22 | base.Initialize(); 23 | 24 | Context.OnCellClicked = SelectCell; 25 | 26 | scroller.OnValueChanged(UpdatePosition); 27 | scroller.OnSelectionChanged(UpdateSelection); 28 | } 29 | 30 | void UpdateSelection(int index) 31 | { 32 | if (Context.SelectedIndex == index) 33 | { 34 | return; 35 | } 36 | 37 | Context.SelectedIndex = index; 38 | Refresh(); 39 | } 40 | 41 | public void UpdateData(IList items) 42 | { 43 | UpdateContents(items); 44 | scroller.SetTotalCount(items.Count); 45 | } 46 | 47 | public void SelectCell(int index) 48 | { 49 | if (index < 0 || index >= ItemsSource.Count || index == Context.SelectedIndex) 50 | { 51 | return; 52 | } 53 | 54 | UpdateSelection(index); 55 | scroller.ScrollTo(index, 0.35f, Ease.OutCubic); 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/03_InfiniteScroll/ScrollView.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5b1ee62a075132e49b6fc82cd114e89d 3 | timeCreated: 1487505830 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/04_Metaball.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d8b45c628741d489794278febcefa995 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/04_Metaball/Background.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * FancyScrollView (https://github.com/setchi/FancyScrollView) 3 | * Copyright (c) 2020 setchi 4 | * Licensed under MIT (https://github.com/setchi/FancyScrollView/blob/master/LICENSE) 5 | */ 6 | 7 | using System.Linq; 8 | using UnityEngine; 9 | using UnityEngine.EventSystems; 10 | using UnityEngine.UI; 11 | 12 | namespace FancyScrollView.Example04 13 | { 14 | class Background : MonoBehaviour, IPointerClickHandler 15 | { 16 | [SerializeField] Image background = default; 17 | [SerializeField] ScrollView scrollView = default; 18 | 19 | RectTransform rectTransform; 20 | 21 | static class Uniform 22 | { 23 | public static readonly int Resolution = Shader.PropertyToID("_Resolution"); 24 | public static readonly int CellState = Shader.PropertyToID("_CellState"); 25 | } 26 | 27 | void Start() 28 | { 29 | rectTransform = transform as RectTransform; 30 | } 31 | 32 | void LateUpdate() 33 | { 34 | var offset = scrollView.CellInstanceCount; 35 | 36 | scrollView.SetCellState(offset + 0, -1, 500, -330 + Mathf.Sin(Time.time) * 60, 2.5f); 37 | scrollView.SetCellState(offset + 1, -1, -500, -330 + Mathf.Sin(Time.time) * 60, 2.5f); 38 | 39 | background.material.SetVector(Uniform.Resolution, rectTransform.rect.size); 40 | background.material.SetVectorArray(Uniform.CellState, scrollView.GetCellState()); 41 | } 42 | 43 | bool MetaballContains(Vector2 p, Vector4[] cellState) 44 | { 45 | float f(Vector2 v) => 1f / (v.x * v.x + v.y * v.y + 0.0001f); 46 | 47 | const float scale = 4600f; 48 | var d = cellState.Sum(x => f(p - new Vector2(x.x, x.y)) * x.w); 49 | return d * scale > 0.46f; 50 | } 51 | 52 | void IPointerClickHandler.OnPointerClick(PointerEventData eventData) 53 | { 54 | if (eventData.dragging) 55 | { 56 | return; 57 | } 58 | 59 | RectTransformUtility.ScreenPointToLocalPointInRectangle( 60 | rectTransform, 61 | eventData.position, 62 | eventData.pressEventCamera, 63 | out var clickPosition 64 | ); 65 | 66 | var cellState = scrollView.GetCellState(); 67 | if (!MetaballContains(clickPosition, cellState)) 68 | { 69 | return; 70 | } 71 | 72 | var dataIndex = cellState 73 | .Take(scrollView.CellInstanceCount) 74 | .Select(s => ( 75 | index: Mathf.RoundToInt(s.z), 76 | distance: (new Vector2(s.x, s.y) - clickPosition).sqrMagnitude 77 | )) 78 | .Aggregate((min, x) => x.distance < min.distance ? x : min) 79 | .index; 80 | 81 | scrollView.SelectCell(dataIndex); 82 | } 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/04_Metaball/Background.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 12a4f1ddc365f410693ef82f43069820 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/04_Metaball/Cell.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * FancyScrollView (https://github.com/setchi/FancyScrollView) 3 | * Copyright (c) 2020 setchi 4 | * Licensed under MIT (https://github.com/setchi/FancyScrollView/blob/master/LICENSE) 5 | */ 6 | 7 | using UnityEngine; 8 | using UnityEngine.UI; 9 | 10 | namespace FancyScrollView.Example04 11 | { 12 | [ExecuteInEditMode] 13 | class Cell : FancyCell 14 | { 15 | [SerializeField] Animator scrollAnimator = default; 16 | [SerializeField] Animator selectAnimator = default; 17 | [SerializeField] Text message = default; 18 | [SerializeField] Image image = default; 19 | [SerializeField] Button button = default; 20 | [SerializeField] RectTransform rectTransform = default; 21 | [SerializeField, HideInInspector] Vector3 position = default; 22 | 23 | static class AnimatorHash 24 | { 25 | public static readonly int Scroll = Animator.StringToHash("scroll"); 26 | public static readonly int In = Animator.StringToHash("in"); 27 | public static readonly int Out = Animator.StringToHash("out"); 28 | } 29 | 30 | float hash; 31 | bool currentSelection; 32 | 33 | public override void Initialize() 34 | { 35 | hash = Random.value * 100f; 36 | button.onClick.AddListener(() => Context.OnCellClicked?.Invoke(Index)); 37 | 38 | Context.UpdateCellState += () => 39 | { 40 | var siblingIndex = rectTransform.GetSiblingIndex(); 41 | var scale = Mathf.Min(1f, 10 * (0.5f - Mathf.Abs(currentPosition - 0.5f))); 42 | var position = IsVisible 43 | ? this.position + GetFluctuation() 44 | : rectTransform.rect.size.x * 10f * Vector3.left; 45 | 46 | Context.SetCellState(siblingIndex, Index, position.x, position.y, scale); 47 | }; 48 | } 49 | 50 | void LateUpdate() 51 | { 52 | image.rectTransform.localPosition = position + GetFluctuation(); 53 | } 54 | 55 | Vector3 GetFluctuation() 56 | { 57 | var fluctX = Mathf.Sin(Time.time + hash * 40) * 12; 58 | var fluctY = Mathf.Sin(Time.time + hash) * 12; 59 | return new Vector3(fluctX, fluctY, 0f); 60 | } 61 | 62 | public override void UpdateContent(ItemData cellData) 63 | { 64 | message.text = cellData.Message; 65 | SetSelection(Context.SelectedIndex == Index); 66 | } 67 | 68 | public override void UpdatePosition(float position) 69 | { 70 | currentPosition = position; 71 | 72 | if (scrollAnimator.isActiveAndEnabled) 73 | { 74 | scrollAnimator.Play(AnimatorHash.Scroll, -1, position); 75 | } 76 | 77 | scrollAnimator.speed = 0; 78 | } 79 | 80 | void SetSelection(bool selected) 81 | { 82 | if (currentSelection == selected) 83 | { 84 | return; 85 | } 86 | 87 | currentSelection = selected; 88 | selectAnimator.SetTrigger(selected ? AnimatorHash.In : AnimatorHash.Out); 89 | } 90 | 91 | // GameObject が非アクティブになると Animator がリセットされてしまうため 92 | // 現在位置を保持しておいて OnEnable のタイミングで現在位置を再設定します 93 | float currentPosition = 0; 94 | 95 | void OnEnable() => UpdatePosition(currentPosition); 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/04_Metaball/Cell.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 40396799ba32f440c9bd2e25af94187e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/04_Metaball/Cell.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3b1bba7bd21cb4831974db8459033758 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/04_Metaball/CellScroll.anim.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9587751de6ea044eaa34c59480d4685b 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 7400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/04_Metaball/CellScroll.controller: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!91 &9100000 4 | AnimatorController: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_Name: CellScroll 10 | serializedVersion: 5 11 | m_AnimatorParameters: 12 | - m_Name: scroll 13 | m_Type: 9 14 | m_DefaultFloat: 0 15 | m_DefaultInt: 0 16 | m_DefaultBool: 1 17 | m_Controller: {fileID: 9100000} 18 | m_AnimatorLayers: 19 | - serializedVersion: 5 20 | m_Name: Base Layer 21 | m_StateMachine: {fileID: 1107904440216339570} 22 | m_Mask: {fileID: 0} 23 | m_Motions: [] 24 | m_Behaviours: [] 25 | m_BlendingMode: 0 26 | m_SyncedLayerIndex: -1 27 | m_DefaultWeight: 0 28 | m_IKPass: 0 29 | m_SyncedLayerAffectsTiming: 0 30 | m_Controller: {fileID: 9100000} 31 | --- !u!1101 &1101181072344081740 32 | AnimatorStateTransition: 33 | m_ObjectHideFlags: 1 34 | m_CorrespondingSourceObject: {fileID: 0} 35 | m_PrefabInstance: {fileID: 0} 36 | m_PrefabAsset: {fileID: 0} 37 | m_Name: 38 | m_Conditions: [] 39 | m_DstStateMachine: {fileID: 0} 40 | m_DstState: {fileID: 1102900943980948860} 41 | m_Solo: 0 42 | m_Mute: 0 43 | m_IsExit: 0 44 | serializedVersion: 3 45 | m_TransitionDuration: 0 46 | m_TransitionOffset: 0 47 | m_ExitTime: 0 48 | m_HasExitTime: 1 49 | m_HasFixedDuration: 1 50 | m_InterruptionSource: 0 51 | m_OrderedInterruption: 1 52 | m_CanTransitionToSelf: 1 53 | --- !u!1102 &1102900943980948860 54 | AnimatorState: 55 | serializedVersion: 5 56 | m_ObjectHideFlags: 1 57 | m_CorrespondingSourceObject: {fileID: 0} 58 | m_PrefabInstance: {fileID: 0} 59 | m_PrefabAsset: {fileID: 0} 60 | m_Name: scroll 61 | m_Speed: 1 62 | m_CycleOffset: 0 63 | m_Transitions: [] 64 | m_StateMachineBehaviours: [] 65 | m_Position: {x: 50, y: 50, z: 0} 66 | m_IKOnFeet: 0 67 | m_WriteDefaultValues: 1 68 | m_Mirror: 0 69 | m_SpeedParameterActive: 0 70 | m_MirrorParameterActive: 0 71 | m_CycleOffsetParameterActive: 0 72 | m_TimeParameterActive: 0 73 | m_Motion: {fileID: 7400000, guid: 9587751de6ea044eaa34c59480d4685b, type: 2} 74 | m_Tag: 75 | m_SpeedParameter: 76 | m_MirrorParameter: 77 | m_CycleOffsetParameter: 78 | m_TimeParameter: 79 | --- !u!1107 &1107904440216339570 80 | AnimatorStateMachine: 81 | serializedVersion: 5 82 | m_ObjectHideFlags: 1 83 | m_CorrespondingSourceObject: {fileID: 0} 84 | m_PrefabInstance: {fileID: 0} 85 | m_PrefabAsset: {fileID: 0} 86 | m_Name: Base Layer 87 | m_ChildStates: 88 | - serializedVersion: 1 89 | m_State: {fileID: 1102900943980948860} 90 | m_Position: {x: 252, y: 24, z: 0} 91 | m_ChildStateMachines: [] 92 | m_AnyStateTransitions: 93 | - {fileID: 1101181072344081740} 94 | m_EntryTransitions: [] 95 | m_StateMachineTransitions: {} 96 | m_StateMachineBehaviours: [] 97 | m_AnyStatePosition: {x: 50, y: 20, z: 0} 98 | m_EntryPosition: {x: 50, y: 120, z: 0} 99 | m_ExitPosition: {x: 800, y: 120, z: 0} 100 | m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} 101 | m_DefaultState: {fileID: 1102900943980948860} 102 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/04_Metaball/CellScroll.controller.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4674b9fce23ad412d85402ffa13bc172 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/04_Metaball/Context.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * FancyScrollView (https://github.com/setchi/FancyScrollView) 3 | * Copyright (c) 2020 setchi 4 | * Licensed under MIT (https://github.com/setchi/FancyScrollView/blob/master/LICENSE) 5 | */ 6 | 7 | using System; 8 | using UnityEngine; 9 | 10 | namespace FancyScrollView.Example04 11 | { 12 | class Context 13 | { 14 | public int SelectedIndex = -1; 15 | 16 | // Cell -> ScrollView 17 | public Action OnCellClicked; 18 | 19 | // ScrollView -> Cell 20 | public Action UpdateCellState; 21 | 22 | // xy = cell position, z = data index, w = scale 23 | public Vector4[] CellState = new Vector4[1]; 24 | 25 | public void SetCellState(int cellIndex, int dataIndex, float x, float y, float scale) 26 | { 27 | var size = cellIndex + 1; 28 | if (size > CellState.Length) 29 | { 30 | Array.Resize(ref CellState, size); 31 | } 32 | 33 | CellState[cellIndex].x = x; 34 | CellState[cellIndex].y = y; 35 | CellState[cellIndex].z = dataIndex; 36 | CellState[cellIndex].w = scale; 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/04_Metaball/Context.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 287b72b39f09a49e8a91ae7a2fd9ee90 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/04_Metaball/Example04.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * FancyScrollView (https://github.com/setchi/FancyScrollView) 3 | * Copyright (c) 2020 setchi 4 | * Licensed under MIT (https://github.com/setchi/FancyScrollView/blob/master/LICENSE) 5 | */ 6 | 7 | using System.Linq; 8 | using UnityEngine; 9 | using UnityEngine.UI; 10 | 11 | namespace FancyScrollView.Example04 12 | { 13 | class Example04 : MonoBehaviour 14 | { 15 | [SerializeField] ScrollView scrollView = default; 16 | [SerializeField] Button prevCellButton = default; 17 | [SerializeField] Button nextCellButton = default; 18 | [SerializeField] Text selectedItemInfo = default; 19 | 20 | void Start() 21 | { 22 | prevCellButton.onClick.AddListener(scrollView.SelectPrevCell); 23 | nextCellButton.onClick.AddListener(scrollView.SelectNextCell); 24 | scrollView.OnSelectionChanged(OnSelectionChanged); 25 | 26 | var items = Enumerable.Range(0, 20) 27 | .Select(i => new ItemData($"Cell {i}")) 28 | .ToList(); 29 | 30 | scrollView.UpdateData(items); 31 | scrollView.UpdateSelection(10); 32 | scrollView.JumpTo(10); 33 | } 34 | 35 | void OnSelectionChanged(int index) 36 | { 37 | selectedItemInfo.text = $"Selected item info: index {index}"; 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/04_Metaball/Example04.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0fc372c40c6af4438944600b923668d7 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/04_Metaball/ItemData.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * FancyScrollView (https://github.com/setchi/FancyScrollView) 3 | * Copyright (c) 2020 setchi 4 | * Licensed under MIT (https://github.com/setchi/FancyScrollView/blob/master/LICENSE) 5 | */ 6 | 7 | namespace FancyScrollView.Example04 8 | { 9 | class ItemData 10 | { 11 | public string Message { get; } 12 | 13 | public ItemData(string message) 14 | { 15 | Message = message; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/04_Metaball/ItemData.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f8910d0fae084439daefd18766243f4d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/04_Metaball/Metaball.hlsl: -------------------------------------------------------------------------------- 1 | /* 2 | * FancyScrollView (https://github.com/setchi/FancyScrollView) 3 | * Copyright (c) 2020 setchi 4 | * Licensed under MIT (https://github.com/setchi/FancyScrollView/blob/master/LICENSE) 5 | */ 6 | 7 | #ifndef GALLERY_METABALL_HLSL_INCLUDED 8 | #define GALLERY_METABALL_HLSL_INCLUDED 9 | 10 | #define CELL_COUNT 5 // CeilToInt(1f / cellInterval) 11 | #define DATA_COUNT 7 // CELL_COUNT + 2(objects) 12 | 13 | // xy = cell position, z = data index, w = scale 14 | float4 _CellState[DATA_COUNT]; 15 | 16 | float f(float2 v) 17 | { 18 | return 1. / (v.x * v.x + v.y * v.y + .0001); 19 | } 20 | 21 | float4 metaball(float2 st) 22 | { 23 | float scale = 4600; 24 | float d = 0; 25 | 26 | [unroll] 27 | for (int i = 0; i < DATA_COUNT; i++) 28 | { 29 | d += f(st - _CellState[i].xy) * _CellState[i].w; 30 | } 31 | 32 | d *= scale; 33 | d = abs(d - 0.5); 34 | 35 | float3 color = 1; 36 | color = lerp(color, float3(0.16, 0.07, 0.31), smoothstep(d - 0.04, d - 0.04 + 0.002, 0)); 37 | color = lerp(color, float3(0.16, 0.80, 0.80), smoothstep(d - 0.02, d - 0.02 + 0.002, 0)); 38 | return float4(color, 1); 39 | } 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/04_Metaball/Metaball.hlsl.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f64a7b68bccf94491a40cb228fb9e099 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/04_Metaball/Metaball.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: Metaball 11 | m_Shader: {fileID: 4800000, guid: 90d937d5063604abaa5baee058cb1541, type: 3} 12 | m_ShaderKeywords: 13 | m_LightmapFlags: 4 14 | m_EnableInstancingVariants: 0 15 | m_DoubleSidedGI: 0 16 | m_CustomRenderQueue: -1 17 | stringTagMap: {} 18 | disabledShaderPasses: [] 19 | m_SavedProperties: 20 | serializedVersion: 3 21 | m_TexEnvs: 22 | - _BumpMap: 23 | m_Texture: {fileID: 0} 24 | m_Scale: {x: 1, y: 1} 25 | m_Offset: {x: 0, y: 0} 26 | - _DetailAlbedoMap: 27 | m_Texture: {fileID: 0} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | - _DetailMask: 31 | m_Texture: {fileID: 0} 32 | m_Scale: {x: 1, y: 1} 33 | m_Offset: {x: 0, y: 0} 34 | - _DetailNormalMap: 35 | m_Texture: {fileID: 0} 36 | m_Scale: {x: 1, y: 1} 37 | m_Offset: {x: 0, y: 0} 38 | - _EmissionMap: 39 | m_Texture: {fileID: 0} 40 | m_Scale: {x: 1, y: 1} 41 | m_Offset: {x: 0, y: 0} 42 | - _MainTex: 43 | m_Texture: {fileID: 0} 44 | m_Scale: {x: 1, y: 1} 45 | m_Offset: {x: 0, y: 0} 46 | - _MetallicGlossMap: 47 | m_Texture: {fileID: 0} 48 | m_Scale: {x: 1, y: 1} 49 | m_Offset: {x: 0, y: 0} 50 | - _OcclusionMap: 51 | m_Texture: {fileID: 0} 52 | m_Scale: {x: 1, y: 1} 53 | m_Offset: {x: 0, y: 0} 54 | - _ParallaxMap: 55 | m_Texture: {fileID: 0} 56 | m_Scale: {x: 1, y: 1} 57 | m_Offset: {x: 0, y: 0} 58 | - _SpecGlossMap: 59 | m_Texture: {fileID: 0} 60 | m_Scale: {x: 1, y: 1} 61 | m_Offset: {x: 0, y: 0} 62 | m_Floats: 63 | - _BumpScale: 1 64 | - _ColorMask: 15 65 | - _Cutoff: 0.5 66 | - _DetailNormalMapScale: 1 67 | - _DstBlend: 0 68 | - _GlossMapScale: 1 69 | - _Glossiness: 0.5 70 | - _GlossyReflections: 1 71 | - _Metallic: 0 72 | - _Mode: 0 73 | - _OcclusionStrength: 1 74 | - _Parallax: 0.02 75 | - _SmoothnessTextureChannel: 0 76 | - _SpecularHighlights: 1 77 | - _SrcBlend: 1 78 | - _Stencil: 0 79 | - _StencilComp: 8 80 | - _StencilOp: 0 81 | - _StencilReadMask: 255 82 | - _StencilWriteMask: 255 83 | - _UVSec: 0 84 | - _UseUIAlphaClip: 0 85 | - _ZWrite: 1 86 | m_Colors: 87 | - _Color: {r: 1, g: 1, b: 1, a: 1} 88 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 89 | - _SpecColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} 90 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/04_Metaball/Metaball.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f5c08468e32184438b6b0486eab5426e 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/04_Metaball/Metaball.shader: -------------------------------------------------------------------------------- 1 | /* 2 | * FancyScrollView (https://github.com/setchi/FancyScrollView) 3 | * Copyright (c) 2020 setchi 4 | * Licensed under MIT (https://github.com/setchi/FancyScrollView/blob/master/LICENSE) 5 | */ 6 | 7 | Shader "FancyScrollViewGallery/Metaball" 8 | { 9 | Properties 10 | { 11 | [PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {} 12 | _Color ("Tint", Color) = (1,1,1,1) 13 | 14 | _StencilComp ("Stencil Comparison", Float) = 8 15 | _Stencil ("Stencil ID", Float) = 0 16 | _StencilOp ("Stencil Operation", Float) = 0 17 | _StencilWriteMask ("Stencil Write Mask", Float) = 255 18 | _StencilReadMask ("Stencil Read Mask", Float) = 255 19 | 20 | _ColorMask ("Color Mask", Float) = 15 21 | 22 | [Toggle(UNITY_UI_ALPHACLIP)] _UseUIAlphaClip ("Use Alpha Clip", Float) = 0 23 | } 24 | 25 | CGINCLUDE 26 | #include "UnityCG.cginc" 27 | #include "UnityUI.cginc" 28 | #include "../Common/Common.cginc" 29 | #include "Metaball.hlsl" 30 | 31 | #pragma multi_compile __ UNITY_UI_CLIP_RECT 32 | #pragma multi_compile __ UNITY_UI_ALPHACLIP 33 | 34 | struct appdata_t 35 | { 36 | float4 vertex : POSITION; 37 | float4 color : COLOR; 38 | float2 texcoord : TEXCOORD0; 39 | UNITY_VERTEX_INPUT_INSTANCE_ID 40 | }; 41 | 42 | struct v2f 43 | { 44 | float4 vertex : SV_POSITION; 45 | fixed4 color : COLOR; 46 | float2 uiCoord : TEXCOORD0; 47 | float4 worldPosition : TEXCOORD1; 48 | UNITY_VERTEX_OUTPUT_STEREO 49 | }; 50 | 51 | sampler2D _MainTex; 52 | fixed4 _Color; 53 | fixed4 _TextureSampleAdd; 54 | float4 _ClipRect; 55 | float4 _MainTex_ST; 56 | 57 | v2f vert(appdata_t v) 58 | { 59 | v2f OUT; 60 | UNITY_SETUP_INSTANCE_ID(v); 61 | UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(OUT); 62 | OUT.worldPosition = v.vertex; 63 | OUT.vertex = UnityObjectToClipPos(OUT.worldPosition); 64 | 65 | OUT.uiCoord = ui_coord(TRANSFORM_TEX(v.texcoord, _MainTex)); 66 | 67 | OUT.color = v.color * _Color; 68 | return OUT; 69 | } 70 | 71 | fixed4 frag(v2f i) : SV_Target 72 | { 73 | half4 color = metaball(i.uiCoord); 74 | 75 | color += _TextureSampleAdd; 76 | color *= i.color; 77 | 78 | #ifdef UNITY_UI_CLIP_RECT 79 | color.a *= UnityGet2DClipping(i.worldPosition.xy, _ClipRect); 80 | #endif 81 | 82 | #ifdef UNITY_UI_ALPHACLIP 83 | clip(color.a - 0.001); 84 | #endif 85 | 86 | return color; 87 | } 88 | ENDCG 89 | 90 | SubShader 91 | { 92 | Tags 93 | { 94 | "Queue"="Transparent" 95 | "IgnoreProjector"="True" 96 | "RenderType"="Transparent" 97 | "PreviewType"="Plane" 98 | "CanUseSpriteAtlas"="True" 99 | } 100 | 101 | Stencil 102 | { 103 | Ref [_Stencil] 104 | Comp [_StencilComp] 105 | Pass [_StencilOp] 106 | ReadMask [_StencilReadMask] 107 | WriteMask [_StencilWriteMask] 108 | } 109 | 110 | Cull Off 111 | Lighting Off 112 | ZWrite Off 113 | ZTest [unity_GUIZTestMode] 114 | Blend SrcAlpha OneMinusSrcAlpha 115 | ColorMask [_ColorMask] 116 | 117 | Pass 118 | { 119 | Name "Default" 120 | 121 | CGPROGRAM 122 | #pragma vertex vert 123 | #pragma fragment frag 124 | #pragma target 2.0 125 | ENDCG 126 | } 127 | } 128 | } 129 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/04_Metaball/Metaball.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 90d937d5063604abaa5baee058cb1541 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/04_Metaball/ScrollView.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * FancyScrollView (https://github.com/setchi/FancyScrollView) 3 | * Copyright (c) 2020 setchi 4 | * Licensed under MIT (https://github.com/setchi/FancyScrollView/blob/master/LICENSE) 5 | */ 6 | 7 | using System; 8 | using System.Collections.Generic; 9 | using UnityEngine; 10 | using EasingCore; 11 | 12 | namespace FancyScrollView.Example04 13 | { 14 | class ScrollView : FancyScrollView 15 | { 16 | [SerializeField] Scroller scroller = default; 17 | [SerializeField] GameObject cellPrefab = default; 18 | 19 | Action onSelectionChanged; 20 | 21 | protected override GameObject CellPrefab => cellPrefab; 22 | 23 | public int CellInstanceCount => Mathf.CeilToInt(1f / Mathf.Max(cellInterval, 1e-3f)); 24 | 25 | protected override void Initialize() 26 | { 27 | base.Initialize(); 28 | 29 | Context.OnCellClicked = SelectCell; 30 | 31 | scroller.OnValueChanged(UpdatePosition); 32 | scroller.OnSelectionChanged(UpdateSelection); 33 | } 34 | 35 | public void UpdateSelection(int index) 36 | { 37 | if (Context.SelectedIndex == index) 38 | { 39 | return; 40 | } 41 | 42 | Context.SelectedIndex = index; 43 | Refresh(); 44 | 45 | onSelectionChanged?.Invoke(index); 46 | } 47 | 48 | public void UpdateData(IList items) 49 | { 50 | UpdateContents(items); 51 | scroller.SetTotalCount(items.Count); 52 | } 53 | 54 | public void OnSelectionChanged(Action callback) 55 | { 56 | onSelectionChanged = callback; 57 | } 58 | 59 | public void SelectNextCell() 60 | { 61 | SelectCell(Context.SelectedIndex + 1); 62 | } 63 | 64 | public void SelectPrevCell() 65 | { 66 | SelectCell(Context.SelectedIndex - 1); 67 | } 68 | 69 | public void SelectCell(int index) 70 | { 71 | if (index < 0 || index >= ItemsSource.Count || index == Context.SelectedIndex) 72 | { 73 | return; 74 | } 75 | 76 | UpdateSelection(index); 77 | ScrollTo(index, 0.35f, Ease.OutCubic); 78 | } 79 | 80 | public void ScrollTo(float position, float duration, Ease easing, Action onComplete = null) 81 | { 82 | scroller.ScrollTo(position, duration, easing, onComplete); 83 | } 84 | 85 | public void JumpTo(int index) 86 | { 87 | scroller.JumpTo(index); 88 | } 89 | 90 | public Vector4[] GetCellState() 91 | { 92 | Context.UpdateCellState?.Invoke(); 93 | return Context.CellState; 94 | } 95 | 96 | public void SetCellState(int cellIndex, int dataIndex, float x, float y, float scale) 97 | { 98 | Context.SetCellState(cellIndex, dataIndex, x, y, scale); 99 | } 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/04_Metaball/ScrollView.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a6ff2d05912944525b9c4a38adcd8111 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/05_Voronoi.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 118a78da718b74971b5d69f553d7d558 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/05_Voronoi/Background.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * FancyScrollView (https://github.com/setchi/FancyScrollView) 3 | * Copyright (c) 2020 setchi 4 | * Licensed under MIT (https://github.com/setchi/FancyScrollView/blob/master/LICENSE) 5 | */ 6 | 7 | using System.Linq; 8 | using UnityEngine; 9 | using UnityEngine.EventSystems; 10 | using UnityEngine.UI; 11 | 12 | namespace FancyScrollView.Example05 13 | { 14 | class Background : MonoBehaviour, IPointerClickHandler 15 | { 16 | [SerializeField] Image background = default; 17 | [SerializeField] ScrollView scrollView = default; 18 | 19 | RectTransform rectTransform; 20 | 21 | static class Uniform 22 | { 23 | public static readonly int Resolution = Shader.PropertyToID("_Resolution"); 24 | public static readonly int CellState = Shader.PropertyToID("_CellState"); 25 | } 26 | 27 | void Start() 28 | { 29 | rectTransform = transform as RectTransform; 30 | } 31 | 32 | void LateUpdate() 33 | { 34 | var rect = rectTransform.rect.size * 0.5f; 35 | var offset = scrollView.CellInstanceCount; 36 | 37 | scrollView.SetCellState(offset + 0, -1, rect.x, -rect.y * 1.3f, 0f); 38 | scrollView.SetCellState(offset + 1, -1, -rect.x, rect.y * 1.3f, 0f); 39 | scrollView.SetCellState(offset + 2, -1, -rect.x, -rect.y * 1.3f, 0f); 40 | scrollView.SetCellState(offset + 3, -1, rect.x, rect.y * 1.3f, 0f); 41 | 42 | background.material.SetVector(Uniform.Resolution, rectTransform.rect.size); 43 | background.material.SetVectorArray(Uniform.CellState, scrollView.GetCellState()); 44 | } 45 | 46 | void IPointerClickHandler.OnPointerClick(PointerEventData eventData) 47 | { 48 | if (eventData.dragging) 49 | { 50 | return; 51 | } 52 | 53 | RectTransformUtility.ScreenPointToLocalPointInRectangle( 54 | rectTransform, 55 | eventData.position, 56 | eventData.pressEventCamera, 57 | out var clickPosition 58 | ); 59 | 60 | var cellState = scrollView.GetCellState() 61 | .Select((s, i) => ( 62 | index: i, 63 | dataIndex: Mathf.RoundToInt(s.z), 64 | position: new Vector2(s.x, s.y) 65 | )); 66 | 67 | var target = cellState 68 | .OrderBy(x => (x.position - clickPosition).sqrMagnitude) 69 | .First(); 70 | 71 | var distance = cellState 72 | .Where(x => x.index != target.index) 73 | .Min(x => Vector2.Dot( 74 | clickPosition - (target.position + x.position) * 0.5f, 75 | (target.position - x.position).normalized 76 | )); 77 | 78 | const float borderWidth = 9; 79 | if (distance < borderWidth) 80 | { 81 | return; 82 | } 83 | 84 | scrollView.SelectCell(target.dataIndex); 85 | } 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/05_Voronoi/Background.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 973db80e5cd7d4f2c82ecb71795647d5 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/05_Voronoi/Cell.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * FancyScrollView (https://github.com/setchi/FancyScrollView) 3 | * Copyright (c) 2020 setchi 4 | * Licensed under MIT (https://github.com/setchi/FancyScrollView/blob/master/LICENSE) 5 | */ 6 | 7 | using UnityEngine; 8 | using UnityEngine.UI; 9 | 10 | namespace FancyScrollView.Example05 11 | { 12 | [ExecuteInEditMode] 13 | class Cell : FancyCell 14 | { 15 | [SerializeField] Animator scrollAnimator = default; 16 | [SerializeField] Animator selectAnimator = default; 17 | [SerializeField] Text message = default; 18 | [SerializeField] Image image = default; 19 | [SerializeField] Button button = default; 20 | [SerializeField] RectTransform rectTransform = default; 21 | [SerializeField, HideInInspector] Vector3 position = default; 22 | 23 | static class AnimatorHash 24 | { 25 | public static readonly int Scroll = Animator.StringToHash("scroll"); 26 | public static readonly int In = Animator.StringToHash("in"); 27 | public static readonly int Out = Animator.StringToHash("out"); 28 | } 29 | 30 | float hash; 31 | bool currentSelection; 32 | float updateSelectionTime; 33 | 34 | public override void Initialize() 35 | { 36 | hash = Random.value * 100f; 37 | button.onClick.AddListener(() => Context.OnCellClicked?.Invoke(Index)); 38 | 39 | Context.UpdateCellState += () => 40 | { 41 | var siblingIndex = rectTransform.GetSiblingIndex(); 42 | var t = Mathf.Clamp01((Time.time - updateSelectionTime) * (1f / 0.3f)); 43 | var selectAnimation = currentSelection ? t : 1f - t; 44 | var position = IsVisible 45 | ? this.position + GetFluctuation() 46 | : rectTransform.rect.size.x * 10f * Vector3.left; 47 | 48 | Context.SetCellState(siblingIndex, Index, position.x, position.y, selectAnimation); 49 | }; 50 | } 51 | 52 | void LateUpdate() 53 | { 54 | image.rectTransform.localPosition = position + GetFluctuation(); 55 | } 56 | 57 | Vector3 GetFluctuation() 58 | { 59 | var fluctX = Mathf.Sin(Time.time + hash * 40) * 10; 60 | var fluctY = Mathf.Sin(Time.time + hash) * 10; 61 | return new Vector3(fluctX, fluctY, 0f); 62 | } 63 | 64 | public override void UpdateContent(ItemData cellData) 65 | { 66 | message.text = cellData.Message; 67 | SetSelection(Context.SelectedIndex == Index); 68 | } 69 | 70 | public override void UpdatePosition(float position) 71 | { 72 | currentPosition = position; 73 | 74 | if (scrollAnimator.isActiveAndEnabled) 75 | { 76 | scrollAnimator.Play(AnimatorHash.Scroll, -1, position); 77 | } 78 | 79 | scrollAnimator.speed = 0; 80 | } 81 | 82 | void SetSelection(bool selected) 83 | { 84 | if (currentSelection == selected) 85 | { 86 | return; 87 | } 88 | 89 | currentSelection = selected; 90 | selectAnimator.SetTrigger(selected ? AnimatorHash.In : AnimatorHash.Out); 91 | updateSelectionTime = Time.time; 92 | } 93 | 94 | // GameObject が非アクティブになると Animator がリセットされてしまうため 95 | // 現在位置を保持しておいて OnEnable のタイミングで現在位置を再設定します 96 | float currentPosition = 0; 97 | 98 | void OnEnable() => UpdatePosition(currentPosition); 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/05_Voronoi/Cell.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9284157ef3dfa471ebf96ee4adc055e5 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/05_Voronoi/Cell.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4b9a0ac1075a04ceb90c38861cc02de8 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/05_Voronoi/CellScroll.anim.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b6d42e7f269b94fb2847502ef8b6937c 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 7400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/05_Voronoi/CellScroll.controller: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!91 &9100000 4 | AnimatorController: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_Name: CellScroll 10 | serializedVersion: 5 11 | m_AnimatorParameters: [] 12 | m_AnimatorLayers: 13 | - serializedVersion: 5 14 | m_Name: Base Layer 15 | m_StateMachine: {fileID: 1107166493676501698} 16 | m_Mask: {fileID: 0} 17 | m_Motions: [] 18 | m_Behaviours: [] 19 | m_BlendingMode: 0 20 | m_SyncedLayerIndex: -1 21 | m_DefaultWeight: 0 22 | m_IKPass: 0 23 | m_SyncedLayerAffectsTiming: 0 24 | m_Controller: {fileID: 9100000} 25 | --- !u!1101 &1101746392722304152 26 | AnimatorStateTransition: 27 | m_ObjectHideFlags: 1 28 | m_CorrespondingSourceObject: {fileID: 0} 29 | m_PrefabInstance: {fileID: 0} 30 | m_PrefabAsset: {fileID: 0} 31 | m_Name: 32 | m_Conditions: [] 33 | m_DstStateMachine: {fileID: 0} 34 | m_DstState: {fileID: 1102813054129691152} 35 | m_Solo: 0 36 | m_Mute: 0 37 | m_IsExit: 0 38 | serializedVersion: 3 39 | m_TransitionDuration: 0 40 | m_TransitionOffset: 0 41 | m_ExitTime: 0 42 | m_HasExitTime: 1 43 | m_HasFixedDuration: 1 44 | m_InterruptionSource: 0 45 | m_OrderedInterruption: 1 46 | m_CanTransitionToSelf: 1 47 | --- !u!1102 &1102813054129691152 48 | AnimatorState: 49 | serializedVersion: 5 50 | m_ObjectHideFlags: 1 51 | m_CorrespondingSourceObject: {fileID: 0} 52 | m_PrefabInstance: {fileID: 0} 53 | m_PrefabAsset: {fileID: 0} 54 | m_Name: scroll 55 | m_Speed: 1 56 | m_CycleOffset: 0 57 | m_Transitions: [] 58 | m_StateMachineBehaviours: [] 59 | m_Position: {x: 50, y: 50, z: 0} 60 | m_IKOnFeet: 0 61 | m_WriteDefaultValues: 1 62 | m_Mirror: 0 63 | m_SpeedParameterActive: 0 64 | m_MirrorParameterActive: 0 65 | m_CycleOffsetParameterActive: 0 66 | m_TimeParameterActive: 0 67 | m_Motion: {fileID: 7400000, guid: b6d42e7f269b94fb2847502ef8b6937c, type: 2} 68 | m_Tag: 69 | m_SpeedParameter: 70 | m_MirrorParameter: 71 | m_CycleOffsetParameter: 72 | m_TimeParameter: 73 | --- !u!1107 &1107166493676501698 74 | AnimatorStateMachine: 75 | serializedVersion: 5 76 | m_ObjectHideFlags: 1 77 | m_CorrespondingSourceObject: {fileID: 0} 78 | m_PrefabInstance: {fileID: 0} 79 | m_PrefabAsset: {fileID: 0} 80 | m_Name: Base Layer 81 | m_ChildStates: 82 | - serializedVersion: 1 83 | m_State: {fileID: 1102813054129691152} 84 | m_Position: {x: 312, y: 12, z: 0} 85 | m_ChildStateMachines: [] 86 | m_AnyStateTransitions: 87 | - {fileID: 1101746392722304152} 88 | m_EntryTransitions: [] 89 | m_StateMachineTransitions: {} 90 | m_StateMachineBehaviours: [] 91 | m_AnyStatePosition: {x: 50, y: 20, z: 0} 92 | m_EntryPosition: {x: 50, y: 120, z: 0} 93 | m_ExitPosition: {x: 800, y: 120, z: 0} 94 | m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} 95 | m_DefaultState: {fileID: 1102813054129691152} 96 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/05_Voronoi/CellScroll.controller.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a9244fb2d18f84aa3b9498f1da7acf74 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 9100000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/05_Voronoi/Context.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * FancyScrollView (https://github.com/setchi/FancyScrollView) 3 | * Copyright (c) 2020 setchi 4 | * Licensed under MIT (https://github.com/setchi/FancyScrollView/blob/master/LICENSE) 5 | */ 6 | 7 | using System; 8 | using UnityEngine; 9 | 10 | namespace FancyScrollView.Example05 11 | { 12 | class Context 13 | { 14 | public int SelectedIndex = -1; 15 | 16 | // Cell -> ScrollView 17 | public Action OnCellClicked; 18 | 19 | // ScrollView -> Cell 20 | public Action UpdateCellState; 21 | 22 | // xy = cell position, z = data index, w = select animation 23 | public Vector4[] CellState = new Vector4[1]; 24 | 25 | public void SetCellState(int cellIndex, int dataIndex, float x, float y, float selectAnimation) 26 | { 27 | var size = cellIndex + 1; 28 | if (size > CellState.Length) 29 | { 30 | Array.Resize(ref CellState, size); 31 | } 32 | 33 | CellState[cellIndex].x = x; 34 | CellState[cellIndex].y = y; 35 | CellState[cellIndex].z = dataIndex; 36 | CellState[cellIndex].w = selectAnimation; 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/05_Voronoi/Context.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 40a22a71e57294fe983b624e53a0ca9a 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/05_Voronoi/Example05.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * FancyScrollView (https://github.com/setchi/FancyScrollView) 3 | * Copyright (c) 2020 setchi 4 | * Licensed under MIT (https://github.com/setchi/FancyScrollView/blob/master/LICENSE) 5 | */ 6 | 7 | using System.Linq; 8 | using UnityEngine; 9 | using UnityEngine.UI; 10 | 11 | namespace FancyScrollView.Example05 12 | { 13 | class Example05 : MonoBehaviour 14 | { 15 | [SerializeField] ScrollView scrollView = default; 16 | [SerializeField] Button prevCellButton = default; 17 | [SerializeField] Button nextCellButton = default; 18 | [SerializeField] Text selectedItemInfo = default; 19 | 20 | void Start() 21 | { 22 | prevCellButton.onClick.AddListener(scrollView.SelectPrevCell); 23 | nextCellButton.onClick.AddListener(scrollView.SelectNextCell); 24 | scrollView.OnSelectionChanged(OnSelectionChanged); 25 | 26 | var items = Enumerable.Range(0, 20) 27 | .Select(i => new ItemData($"Cell {i}")) 28 | .ToList(); 29 | 30 | scrollView.UpdateData(items); 31 | scrollView.UpdateSelection(10); 32 | scrollView.JumpTo(10); 33 | } 34 | 35 | void OnSelectionChanged(int index) 36 | { 37 | selectedItemInfo.text = $"Selected item info: index {index}"; 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/05_Voronoi/Example05.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 385df685e2a2248e1b9beedb32e6be17 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/05_Voronoi/ItemData.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * FancyScrollView (https://github.com/setchi/FancyScrollView) 3 | * Copyright (c) 2020 setchi 4 | * Licensed under MIT (https://github.com/setchi/FancyScrollView/blob/master/LICENSE) 5 | */ 6 | 7 | namespace FancyScrollView.Example05 8 | { 9 | class ItemData 10 | { 11 | public string Message { get; } 12 | 13 | public ItemData(string message) 14 | { 15 | Message = message; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/05_Voronoi/ItemData.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2696a6d8ee6e143b0ace5164a7ed3030 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/05_Voronoi/ScrollView.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * FancyScrollView (https://github.com/setchi/FancyScrollView) 3 | * Copyright (c) 2020 setchi 4 | * Licensed under MIT (https://github.com/setchi/FancyScrollView/blob/master/LICENSE) 5 | */ 6 | 7 | using System; 8 | using System.Collections.Generic; 9 | using UnityEngine; 10 | using EasingCore; 11 | 12 | namespace FancyScrollView.Example05 13 | { 14 | class ScrollView : FancyScrollView 15 | { 16 | [SerializeField] Scroller scroller = default; 17 | [SerializeField] GameObject cellPrefab = default; 18 | 19 | Action onSelectionChanged; 20 | 21 | protected override GameObject CellPrefab => cellPrefab; 22 | 23 | public int CellInstanceCount => Mathf.CeilToInt(1f / Mathf.Max(cellInterval, 1e-3f)); 24 | 25 | protected override void Initialize() 26 | { 27 | base.Initialize(); 28 | 29 | Context.OnCellClicked = SelectCell; 30 | 31 | scroller.OnValueChanged(UpdatePosition); 32 | scroller.OnSelectionChanged(UpdateSelection); 33 | } 34 | 35 | public void UpdateSelection(int index) 36 | { 37 | if (Context.SelectedIndex == index) 38 | { 39 | return; 40 | } 41 | 42 | Context.SelectedIndex = index; 43 | Refresh(); 44 | 45 | onSelectionChanged?.Invoke(index); 46 | } 47 | 48 | public void UpdateData(IList items) 49 | { 50 | UpdateContents(items); 51 | scroller.SetTotalCount(items.Count); 52 | } 53 | 54 | public void OnSelectionChanged(Action callback) 55 | { 56 | onSelectionChanged = callback; 57 | } 58 | 59 | public void SelectNextCell() 60 | { 61 | SelectCell(Context.SelectedIndex + 1); 62 | } 63 | 64 | public void SelectPrevCell() 65 | { 66 | SelectCell(Context.SelectedIndex - 1); 67 | } 68 | 69 | public void SelectCell(int index) 70 | { 71 | if (index < 0 || index >= ItemsSource.Count || index == Context.SelectedIndex) 72 | { 73 | return; 74 | } 75 | 76 | UpdateSelection(index); 77 | ScrollTo(index, 0.35f, Ease.OutCubic); 78 | } 79 | 80 | public void ScrollTo(float position, float duration, Ease easing, Action onComplete = null) 81 | { 82 | scroller.ScrollTo(position, duration, easing, onComplete); 83 | } 84 | 85 | public void JumpTo(int index) 86 | { 87 | scroller.JumpTo(index); 88 | } 89 | 90 | public Vector4[] GetCellState() 91 | { 92 | Context.UpdateCellState?.Invoke(); 93 | return Context.CellState; 94 | } 95 | 96 | public void SetCellState(int cellIndex, int dataIndex, float x, float y, float selectAnimation) 97 | { 98 | Context.SetCellState(cellIndex, dataIndex, x, y, selectAnimation); 99 | } 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/05_Voronoi/ScrollView.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ecf1dd47e5dc54816aa66115c058c29a 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/05_Voronoi/Voronoi.hlsl: -------------------------------------------------------------------------------- 1 | /* 2 | * FancyScrollView (https://github.com/setchi/FancyScrollView) 3 | * Copyright (c) 2020 setchi 4 | * Licensed under MIT (https://github.com/setchi/FancyScrollView/blob/master/LICENSE) 5 | */ 6 | 7 | #ifndef GALLERY_VORONOI_HLSL_INCLUDED 8 | #define GALLERY_VORONOI_HLSL_INCLUDED 9 | 10 | #define CELL_COUNT 7 // CeilToInt(1f / cellInterval) 11 | #define DATA_COUNT 11 // CELL_COUNT + 4(four corners) 12 | 13 | // xy = cell position, z = data index, w = select animation 14 | float4 _CellState[DATA_COUNT]; 15 | 16 | float3 hue_to_rgb(float h) 17 | { 18 | h = frac(h) * 6 - 2; 19 | return saturate(float3(abs(h - 1) - 1, 2 - abs(h), 2 - abs(h - 2))); 20 | } 21 | 22 | float hash(float2 st) 23 | { 24 | float3 p3 = frac(float3(st.xyx) * .1031); 25 | p3 += dot(p3, p3.yzx + 19.19); 26 | return frac((p3.x + p3.y) * p3.z); 27 | } 28 | 29 | float noise(float2 st) 30 | { 31 | float2 i = floor(st); 32 | float2 f = frac(st); 33 | 34 | float a = hash(i); 35 | float b = hash(i + float2(1.0, 0.0)); 36 | float c = hash(i + float2(0.0, 1.0)); 37 | float d = hash(i + float2(1.0, 1.0)); 38 | 39 | float2 u = f * f * (3.0 - 2.0 * f); 40 | return lerp(a, b, u.x) + 41 | (c - a)* u.y * (1.0 - u.x) + 42 | (d - b) * u.x * u.y; 43 | } 44 | 45 | float linework(float2 st) 46 | { 47 | float a = atan2(st.y, st.x); 48 | float d = noise(float2(a * 120, 0)) + smoothstep(300, 50, length(st)); 49 | return 1. - saturate(d); 50 | } 51 | 52 | float4 voronoi(float2 st) 53 | { 54 | float cellIndex = 0, dist = 1e+9; 55 | float2 cellPos = 1e+5; 56 | 57 | [unroll] 58 | for (int i = 0; i < DATA_COUNT; i++) 59 | { 60 | float2 p = _CellState[i].xy; 61 | float2 q = st - p; 62 | float d = q.x * q.x + q.y * q.y; 63 | if (d < dist) 64 | { 65 | dist = d; cellPos = p; cellIndex = i; 66 | } 67 | } 68 | 69 | dist = 1e+5; 70 | 71 | [unroll] 72 | for (int j = 0; j < DATA_COUNT; j++) 73 | { 74 | if (cellIndex == j) continue; 75 | 76 | float2 p = _CellState[j].xy; 77 | float d = dot(st - (cellPos + p) * 0.5, normalize(cellPos - p)); 78 | dist = min(dist, d); 79 | } 80 | 81 | float3 color = 1; 82 | float dataIndex = _CellState[cellIndex].z; 83 | color = hue_to_rgb(dataIndex * 0.1) + 0.1; 84 | color = lerp(color, 0, linework(st - cellPos) * _CellState[cellIndex].w); 85 | color = lerp(color, hue_to_rgb(cellIndex * 0.1) * 0.6, step(CELL_COUNT, cellIndex)); 86 | 87 | float border = smoothstep(0, 13, dist); 88 | color = lerp(0.1, color, smoothstep(0.8 - 0.07, 0.8, border)); 89 | color = lerp(1.0, color, smoothstep(0.5 - 0.07, 0.5, border)); 90 | return float4(color, 1); 91 | } 92 | 93 | #endif 94 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/05_Voronoi/Voronoi.hlsl.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7983bb1f77fb14064b645f387f089d01 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/05_Voronoi/Voronoi.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: Voronoi 11 | m_Shader: {fileID: 4800000, guid: 6d7f769d6caa34873b0666242dde0150, type: 3} 12 | m_ShaderKeywords: 13 | m_LightmapFlags: 4 14 | m_EnableInstancingVariants: 0 15 | m_DoubleSidedGI: 0 16 | m_CustomRenderQueue: -1 17 | stringTagMap: {} 18 | disabledShaderPasses: [] 19 | m_SavedProperties: 20 | serializedVersion: 3 21 | m_TexEnvs: 22 | - _BumpMap: 23 | m_Texture: {fileID: 0} 24 | m_Scale: {x: 1, y: 1} 25 | m_Offset: {x: 0, y: 0} 26 | - _DetailAlbedoMap: 27 | m_Texture: {fileID: 0} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | - _DetailMask: 31 | m_Texture: {fileID: 0} 32 | m_Scale: {x: 1, y: 1} 33 | m_Offset: {x: 0, y: 0} 34 | - _DetailNormalMap: 35 | m_Texture: {fileID: 0} 36 | m_Scale: {x: 1, y: 1} 37 | m_Offset: {x: 0, y: 0} 38 | - _EmissionMap: 39 | m_Texture: {fileID: 0} 40 | m_Scale: {x: 1, y: 1} 41 | m_Offset: {x: 0, y: 0} 42 | - _MainTex: 43 | m_Texture: {fileID: 0} 44 | m_Scale: {x: 1, y: 1} 45 | m_Offset: {x: 0, y: 0} 46 | - _MetallicGlossMap: 47 | m_Texture: {fileID: 0} 48 | m_Scale: {x: 1, y: 1} 49 | m_Offset: {x: 0, y: 0} 50 | - _OcclusionMap: 51 | m_Texture: {fileID: 0} 52 | m_Scale: {x: 1, y: 1} 53 | m_Offset: {x: 0, y: 0} 54 | - _ParallaxMap: 55 | m_Texture: {fileID: 0} 56 | m_Scale: {x: 1, y: 1} 57 | m_Offset: {x: 0, y: 0} 58 | m_Floats: 59 | - _BumpScale: 1 60 | - _ColorMask: 15 61 | - _Cutoff: 0.5 62 | - _DetailNormalMapScale: 1 63 | - _DstBlend: 0 64 | - _GlossMapScale: 1 65 | - _Glossiness: 0.5 66 | - _GlossyReflections: 1 67 | - _Metallic: 0 68 | - _Mode: 0 69 | - _OcclusionStrength: 1 70 | - _Parallax: 0.02 71 | - _SmoothnessTextureChannel: 0 72 | - _SpecularHighlights: 1 73 | - _SrcBlend: 1 74 | - _Stencil: 0 75 | - _StencilComp: 8 76 | - _StencilOp: 0 77 | - _StencilReadMask: 255 78 | - _StencilWriteMask: 255 79 | - _UVSec: 0 80 | - _UseUIAlphaClip: 0 81 | - _ZWrite: 1 82 | m_Colors: 83 | - _Color: {r: 1, g: 1, b: 1, a: 1} 84 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 85 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/05_Voronoi/Voronoi.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bcae195ce62b04834948dca5aceccbb2 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 2100000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/05_Voronoi/Voronoi.shader: -------------------------------------------------------------------------------- 1 | /* 2 | * FancyScrollView (https://github.com/setchi/FancyScrollView) 3 | * Copyright (c) 2020 setchi 4 | * Licensed under MIT (https://github.com/setchi/FancyScrollView/blob/master/LICENSE) 5 | */ 6 | 7 | Shader "FancyScrollViewGallery/Voronoi" 8 | { 9 | Properties 10 | { 11 | [PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {} 12 | _Color ("Tint", Color) = (1,1,1,1) 13 | 14 | _StencilComp ("Stencil Comparison", Float) = 8 15 | _Stencil ("Stencil ID", Float) = 0 16 | _StencilOp ("Stencil Operation", Float) = 0 17 | _StencilWriteMask ("Stencil Write Mask", Float) = 255 18 | _StencilReadMask ("Stencil Read Mask", Float) = 255 19 | 20 | _ColorMask ("Color Mask", Float) = 15 21 | 22 | [Toggle(UNITY_UI_ALPHACLIP)] _UseUIAlphaClip ("Use Alpha Clip", Float) = 0 23 | } 24 | 25 | CGINCLUDE 26 | #include "UnityCG.cginc" 27 | #include "UnityUI.cginc" 28 | #include "../Common/Common.cginc" 29 | #include "Voronoi.hlsl" 30 | 31 | #pragma multi_compile __ UNITY_UI_CLIP_RECT 32 | #pragma multi_compile __ UNITY_UI_ALPHACLIP 33 | 34 | struct appdata_t 35 | { 36 | float4 vertex : POSITION; 37 | float4 color : COLOR; 38 | float2 texcoord : TEXCOORD0; 39 | UNITY_VERTEX_INPUT_INSTANCE_ID 40 | }; 41 | 42 | struct v2f 43 | { 44 | float4 vertex : SV_POSITION; 45 | fixed4 color : COLOR; 46 | float2 uiCoord : TEXCOORD0; 47 | float4 worldPosition : TEXCOORD1; 48 | UNITY_VERTEX_OUTPUT_STEREO 49 | }; 50 | 51 | sampler2D _MainTex; 52 | fixed4 _Color; 53 | fixed4 _TextureSampleAdd; 54 | float4 _ClipRect; 55 | float4 _MainTex_ST; 56 | 57 | v2f vert(appdata_t v) 58 | { 59 | v2f OUT; 60 | UNITY_SETUP_INSTANCE_ID(v); 61 | UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(OUT); 62 | OUT.worldPosition = v.vertex; 63 | OUT.vertex = UnityObjectToClipPos(OUT.worldPosition); 64 | 65 | OUT.uiCoord = ui_coord(TRANSFORM_TEX(v.texcoord, _MainTex)); 66 | 67 | OUT.color = v.color * _Color; 68 | return OUT; 69 | } 70 | 71 | fixed4 frag(v2f i) : SV_Target 72 | { 73 | half4 color = voronoi(i.uiCoord); 74 | 75 | color += _TextureSampleAdd; 76 | color *= i.color; 77 | 78 | #ifdef UNITY_UI_CLIP_RECT 79 | color.a *= UnityGet2DClipping(i.worldPosition.xy, _ClipRect); 80 | #endif 81 | 82 | #ifdef UNITY_UI_ALPHACLIP 83 | clip(color.a - 0.001); 84 | #endif 85 | 86 | return color; 87 | } 88 | 89 | ENDCG 90 | 91 | SubShader 92 | { 93 | Tags 94 | { 95 | "Queue"="Transparent" 96 | "IgnoreProjector"="True" 97 | "RenderType"="Transparent" 98 | "PreviewType"="Plane" 99 | "CanUseSpriteAtlas"="True" 100 | } 101 | 102 | Stencil 103 | { 104 | Ref [_Stencil] 105 | Comp [_StencilComp] 106 | Pass [_StencilOp] 107 | ReadMask [_StencilReadMask] 108 | WriteMask [_StencilWriteMask] 109 | } 110 | 111 | Cull Off 112 | Lighting Off 113 | ZWrite Off 114 | ZTest [unity_GUIZTestMode] 115 | Blend SrcAlpha OneMinusSrcAlpha 116 | ColorMask [_ColorMask] 117 | 118 | Pass 119 | { 120 | Name "Default" 121 | 122 | CGPROGRAM 123 | #pragma vertex vert 124 | #pragma fragment frag 125 | ENDCG 126 | } 127 | } 128 | } 129 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/05_Voronoi/Voronoi.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6d7f769d6caa34873b0666242dde0150 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/06_LoopTabBar.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3f958315ae4d445b9e5f7946b19bd3d8 3 | timeCreated: 1571830530 -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/06_LoopTabBar/Context.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * FancyScrollView (https://github.com/setchi/FancyScrollView) 3 | * Copyright (c) 2020 setchi 4 | * Licensed under MIT (https://github.com/setchi/FancyScrollView/blob/master/LICENSE) 5 | */ 6 | 7 | using System; 8 | 9 | namespace FancyScrollView.Example06 10 | { 11 | class Context 12 | { 13 | public int SelectedIndex = -1; 14 | public Action OnCellClicked; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/06_LoopTabBar/Context.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1e2f464270334b4690f129933f92fa05 3 | timeCreated: 1571830842 -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/06_LoopTabBar/Example06.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * FancyScrollView (https://github.com/setchi/FancyScrollView) 3 | * Copyright (c) 2020 setchi 4 | * Licensed under MIT (https://github.com/setchi/FancyScrollView/blob/master/LICENSE) 5 | */ 6 | 7 | using System.Linq; 8 | using UnityEngine; 9 | using UnityEngine.UI; 10 | 11 | namespace FancyScrollView.Example06 12 | { 13 | class Example06 : MonoBehaviour 14 | { 15 | [SerializeField] ScrollView scrollView = default; 16 | [SerializeField] Text selectedItemInfo = default; 17 | [SerializeField] Window[] windows = default; 18 | 19 | Window currentWindow; 20 | 21 | void Start() 22 | { 23 | scrollView.OnSelectionChanged(OnSelectionChanged); 24 | 25 | var items = Enumerable.Range(0, windows.Length) 26 | .Select(i => new ItemData($"Tab {i}")) 27 | .ToList(); 28 | 29 | scrollView.UpdateData(items); 30 | scrollView.SelectCell(0); 31 | } 32 | 33 | void OnSelectionChanged(int index, MovementDirection direction) 34 | { 35 | selectedItemInfo.text = $"Selected tab info: index {index}"; 36 | 37 | if (currentWindow != null) 38 | { 39 | currentWindow.Out(direction); 40 | currentWindow = null; 41 | } 42 | 43 | if (index >= 0 && index < windows.Length) 44 | { 45 | currentWindow = windows[index]; 46 | currentWindow.In(direction); 47 | } 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/06_LoopTabBar/Example06.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 79da7ab10086c4b8ebec47fb74b71541 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/06_LoopTabBar/ItemData.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * FancyScrollView (https://github.com/setchi/FancyScrollView) 3 | * Copyright (c) 2020 setchi 4 | * Licensed under MIT (https://github.com/setchi/FancyScrollView/blob/master/LICENSE) 5 | */ 6 | 7 | namespace FancyScrollView.Example06 8 | { 9 | class ItemData 10 | { 11 | public string Message { get; } 12 | 13 | public ItemData(string message) 14 | { 15 | Message = message; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/06_LoopTabBar/ItemData.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e4b81c5ed83b4663bbaad92548b593c7 3 | timeCreated: 1571830750 -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/06_LoopTabBar/ScrollView.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * FancyScrollView (https://github.com/setchi/FancyScrollView) 3 | * Copyright (c) 2020 setchi 4 | * Licensed under MIT (https://github.com/setchi/FancyScrollView/blob/master/LICENSE) 5 | */ 6 | 7 | using System; 8 | using System.Collections.Generic; 9 | using UnityEngine; 10 | using EasingCore; 11 | 12 | namespace FancyScrollView.Example06 13 | { 14 | class ScrollView : FancyScrollView 15 | { 16 | [SerializeField] Scroller scroller = default; 17 | [SerializeField] GameObject cellPrefab = default; 18 | 19 | Action onSelectionChanged; 20 | 21 | protected override GameObject CellPrefab => cellPrefab; 22 | 23 | protected override void Initialize() 24 | { 25 | base.Initialize(); 26 | 27 | Context.OnCellClicked = SelectCell; 28 | 29 | scroller.OnValueChanged(UpdatePosition); 30 | scroller.OnSelectionChanged(UpdateSelection); 31 | } 32 | 33 | void UpdateSelection(int index) 34 | { 35 | if (Context.SelectedIndex == index) 36 | { 37 | return; 38 | } 39 | 40 | var direction = scroller.GetMovementDirection(Context.SelectedIndex, index); 41 | 42 | Context.SelectedIndex = index; 43 | Refresh(); 44 | 45 | onSelectionChanged?.Invoke(index, direction); 46 | } 47 | 48 | public void UpdateData(IList items) 49 | { 50 | UpdateContents(items); 51 | scroller.SetTotalCount(items.Count); 52 | } 53 | 54 | public void OnSelectionChanged(Action callback) 55 | { 56 | onSelectionChanged = callback; 57 | } 58 | 59 | public void SelectNextCell() 60 | { 61 | SelectCell(Context.SelectedIndex + 1); 62 | } 63 | 64 | public void SelectPrevCell() 65 | { 66 | SelectCell(Context.SelectedIndex - 1); 67 | } 68 | 69 | public void SelectCell(int index) 70 | { 71 | if (index < 0 || index >= ItemsSource.Count || index == Context.SelectedIndex) 72 | { 73 | return; 74 | } 75 | 76 | scroller.ScrollTo(index, 0.35f, Ease.OutCubic); 77 | } 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/06_LoopTabBar/ScrollView.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dbd902e697c141fc8a5438f6f9598a90 3 | timeCreated: 1571830800 -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/06_LoopTabBar/SlideScreenTransition.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * FancyScrollView (https://github.com/setchi/FancyScrollView) 3 | * Copyright (c) 2020 setchi 4 | * Licensed under MIT (https://github.com/setchi/FancyScrollView/blob/master/LICENSE) 5 | */ 6 | 7 | using UnityEngine; 8 | using UnityEngine.UI; 9 | 10 | namespace FancyScrollView.Example06 11 | { 12 | class SlideScreenTransition : MonoBehaviour 13 | { 14 | [SerializeField] RectTransform targetTransform = default; 15 | [SerializeField] GraphicRaycaster graphicRaycaster = default; 16 | 17 | const float Duration = 0.3f; // example purpose, a fixed number, the same with scroll view duration 18 | 19 | bool shouldAnimate, isOutAnimation; 20 | float timer, startX, endX; 21 | 22 | public void In(MovementDirection direction) => Animate(direction, false); 23 | 24 | public void Out(MovementDirection direction) => Animate(direction, true); 25 | 26 | void Animate(MovementDirection direction, bool isOut) 27 | { 28 | if (shouldAnimate) 29 | { 30 | return; 31 | } 32 | 33 | timer = Duration; 34 | isOutAnimation = isOut; 35 | shouldAnimate = true; 36 | graphicRaycaster.enabled = false; 37 | 38 | if (!isOutAnimation) 39 | { 40 | gameObject.SetActive(true); 41 | } 42 | 43 | switch (direction) 44 | { 45 | case MovementDirection.Left: 46 | endX = -targetTransform.rect.width; 47 | break; 48 | 49 | case MovementDirection.Right: 50 | endX = targetTransform.rect.width; 51 | break; 52 | 53 | default: 54 | Debug.LogWarning("Example only support horizontal direction."); 55 | break; 56 | } 57 | 58 | startX = isOutAnimation ? 0 : -endX; 59 | endX = isOutAnimation ? endX : 0; 60 | 61 | UpdatePosition(0f); 62 | } 63 | 64 | void Update() 65 | { 66 | if (!shouldAnimate) 67 | { 68 | return; 69 | } 70 | 71 | timer -= Time.deltaTime; 72 | 73 | if (timer > 0) 74 | { 75 | UpdatePosition(1f - timer / Duration); 76 | return; 77 | } 78 | 79 | shouldAnimate = false; 80 | graphicRaycaster.enabled = true; 81 | 82 | if (isOutAnimation) 83 | { 84 | gameObject.SetActive(false); 85 | } 86 | 87 | UpdatePosition(1f); 88 | } 89 | 90 | void UpdatePosition(float position) 91 | { 92 | var x = Mathf.Lerp(startX, endX, position); 93 | targetTransform.anchoredPosition = new Vector2(x, targetTransform.anchoredPosition.y); 94 | } 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/06_LoopTabBar/SlideScreenTransition.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 04f89a56080d4bca97a174370126fca4 3 | timeCreated: 1571833810 -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/06_LoopTabBar/Tab.anim.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4900e034452f642819b15ef97cb5fea0 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 7400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/06_LoopTabBar/Tab.controller: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1102 &-4029329507444745875 4 | AnimatorState: 5 | serializedVersion: 5 6 | m_ObjectHideFlags: 1 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: scroll 11 | m_Speed: 1 12 | m_CycleOffset: 0 13 | m_Transitions: [] 14 | m_StateMachineBehaviours: [] 15 | m_Position: {x: 50, y: 50, z: 0} 16 | m_IKOnFeet: 0 17 | m_WriteDefaultValues: 1 18 | m_Mirror: 0 19 | m_SpeedParameterActive: 0 20 | m_MirrorParameterActive: 0 21 | m_CycleOffsetParameterActive: 0 22 | m_TimeParameterActive: 0 23 | m_Motion: {fileID: 7400000, guid: 4900e034452f642819b15ef97cb5fea0, type: 2} 24 | m_Tag: 25 | m_SpeedParameter: 26 | m_MirrorParameter: 27 | m_CycleOffsetParameter: 28 | m_TimeParameter: 29 | --- !u!1107 &-1767319217309793905 30 | AnimatorStateMachine: 31 | serializedVersion: 5 32 | m_ObjectHideFlags: 1 33 | m_CorrespondingSourceObject: {fileID: 0} 34 | m_PrefabInstance: {fileID: 0} 35 | m_PrefabAsset: {fileID: 0} 36 | m_Name: Base Layer 37 | m_ChildStates: 38 | - serializedVersion: 1 39 | m_State: {fileID: -4029329507444745875} 40 | m_Position: {x: 430, y: 70, z: 0} 41 | m_ChildStateMachines: [] 42 | m_AnyStateTransitions: 43 | - {fileID: -1089901295919422234} 44 | m_EntryTransitions: [] 45 | m_StateMachineTransitions: {} 46 | m_StateMachineBehaviours: [] 47 | m_AnyStatePosition: {x: 50, y: 20, z: 0} 48 | m_EntryPosition: {x: 50, y: 120, z: 0} 49 | m_ExitPosition: {x: 800, y: 120, z: 0} 50 | m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} 51 | m_DefaultState: {fileID: -4029329507444745875} 52 | --- !u!1101 &-1089901295919422234 53 | AnimatorStateTransition: 54 | m_ObjectHideFlags: 1 55 | m_CorrespondingSourceObject: {fileID: 0} 56 | m_PrefabInstance: {fileID: 0} 57 | m_PrefabAsset: {fileID: 0} 58 | m_Name: 59 | m_Conditions: [] 60 | m_DstStateMachine: {fileID: 0} 61 | m_DstState: {fileID: -4029329507444745875} 62 | m_Solo: 0 63 | m_Mute: 0 64 | m_IsExit: 0 65 | serializedVersion: 3 66 | m_TransitionDuration: 0 67 | m_TransitionOffset: 0 68 | m_ExitTime: 0 69 | m_HasExitTime: 1 70 | m_HasFixedDuration: 1 71 | m_InterruptionSource: 0 72 | m_OrderedInterruption: 1 73 | m_CanTransitionToSelf: 1 74 | --- !u!91 &9100000 75 | AnimatorController: 76 | m_ObjectHideFlags: 0 77 | m_CorrespondingSourceObject: {fileID: 0} 78 | m_PrefabInstance: {fileID: 0} 79 | m_PrefabAsset: {fileID: 0} 80 | m_Name: Tab 81 | serializedVersion: 5 82 | m_AnimatorParameters: [] 83 | m_AnimatorLayers: 84 | - serializedVersion: 5 85 | m_Name: Base Layer 86 | m_StateMachine: {fileID: -1767319217309793905} 87 | m_Mask: {fileID: 0} 88 | m_Motions: [] 89 | m_Behaviours: [] 90 | m_BlendingMode: 0 91 | m_SyncedLayerIndex: -1 92 | m_DefaultWeight: 0 93 | m_IKPass: 0 94 | m_SyncedLayerAffectsTiming: 0 95 | m_Controller: {fileID: 9100000} 96 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/06_LoopTabBar/Tab.controller.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 83ae2f2da6c1f46679715ab9187ad30f 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 9100000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/06_LoopTabBar/Tab.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * FancyScrollView (https://github.com/setchi/FancyScrollView) 3 | * Copyright (c) 2020 setchi 4 | * Licensed under MIT (https://github.com/setchi/FancyScrollView/blob/master/LICENSE) 5 | */ 6 | 7 | using UnityEngine; 8 | using UnityEngine.UI; 9 | 10 | namespace FancyScrollView.Example06 11 | { 12 | class Tab : FancyCell 13 | { 14 | [SerializeField] Animator animator = default; 15 | [SerializeField] Text message = default; 16 | [SerializeField] Button button = default; 17 | 18 | static class AnimatorHash 19 | { 20 | public static readonly int Scroll = Animator.StringToHash("scroll"); 21 | } 22 | 23 | public override void Initialize() 24 | { 25 | button.onClick.AddListener(() => Context.OnCellClicked?.Invoke(Index)); 26 | } 27 | 28 | public override void UpdateContent(ItemData itemData) 29 | { 30 | message.text = itemData.Message; 31 | } 32 | 33 | public override void UpdatePosition(float position) 34 | { 35 | currentPosition = position; 36 | 37 | if (animator.isActiveAndEnabled) 38 | { 39 | animator.Play(AnimatorHash.Scroll, -1, position); 40 | } 41 | 42 | animator.speed = 0; 43 | } 44 | 45 | // GameObject が非アクティブになると Animator がリセットされてしまうため 46 | // 現在位置を保持しておいて OnEnable のタイミングで現在位置を再設定します 47 | float currentPosition = 0; 48 | 49 | void OnEnable() => UpdatePosition(currentPosition); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/06_LoopTabBar/Tab.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 337b18bbbcee4d2faf7983206cd0f2e9 3 | timeCreated: 1571832230 -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/06_LoopTabBar/Tab.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2aaa7d63c6947420b9c9556e0b666aca 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/06_LoopTabBar/Window.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * FancyScrollView (https://github.com/setchi/FancyScrollView) 3 | * Copyright (c) 2020 setchi 4 | * Licensed under MIT (https://github.com/setchi/FancyScrollView/blob/master/LICENSE) 5 | */ 6 | 7 | using UnityEngine; 8 | 9 | namespace FancyScrollView.Example06 10 | { 11 | class Window : MonoBehaviour 12 | { 13 | [SerializeField] SlideScreenTransition transition = default; 14 | 15 | public void In(MovementDirection direction) => transition?.In(direction); 16 | 17 | public void Out(MovementDirection direction) => transition?.Out(direction); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/06_LoopTabBar/Window.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2e8d9723b6de4a9581027e8d8c10b353 3 | timeCreated: 1571836778 -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/06_LoopTabBar/Window.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: de225ab998d364b3fb185d53340d8cd6 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/07_ScrollRect.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 46a59130f2f5b4786be478cb87e36f56 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/07_ScrollRect/Alignment.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * FancyScrollView (https://github.com/setchi/FancyScrollView) 3 | * Copyright (c) 2020 setchi 4 | * Licensed under MIT (https://github.com/setchi/FancyScrollView/blob/master/LICENSE) 5 | */ 6 | 7 | namespace FancyScrollView.Example07 8 | { 9 | enum Alignment 10 | { 11 | Upper, 12 | Middle, 13 | Lower, 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/07_ScrollRect/Alignment.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3737ecf2b4681443fa9c1e3e783e0a94 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/07_ScrollRect/Cell.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * FancyScrollView (https://github.com/setchi/FancyScrollView) 3 | * Copyright (c) 2020 setchi 4 | * Licensed under MIT (https://github.com/setchi/FancyScrollView/blob/master/LICENSE) 5 | */ 6 | 7 | using UnityEngine; 8 | using UnityEngine.UI; 9 | 10 | namespace FancyScrollView.Example07 11 | { 12 | class Cell : FancyScrollRectCell 13 | { 14 | [SerializeField] Text message = default; 15 | [SerializeField] Image image = default; 16 | [SerializeField] Button button = default; 17 | 18 | public override void Initialize() 19 | { 20 | button.onClick.AddListener(() => Context.OnCellClicked?.Invoke(Index)); 21 | } 22 | 23 | public override void UpdateContent(ItemData itemData) 24 | { 25 | message.text = itemData.Message; 26 | 27 | var selected = Context.SelectedIndex == Index; 28 | image.color = selected 29 | ? new Color32(0, 255, 255, 100) 30 | : new Color32(255, 255, 255, 77); 31 | } 32 | 33 | protected override void UpdatePosition(float normalizedPosition, float localPosition) 34 | { 35 | base.UpdatePosition(normalizedPosition, localPosition); 36 | 37 | var wave = Mathf.Sin(normalizedPosition * Mathf.PI * 2) * 65; 38 | transform.localPosition += Vector3.right * wave; 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/07_ScrollRect/Cell.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 260de9ddec4e0487f864eee6c5f6c22a 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/07_ScrollRect/Cell.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: efa276bbc93594b8d9fd30eb37d79102 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/07_ScrollRect/Context.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * FancyScrollView (https://github.com/setchi/FancyScrollView) 3 | * Copyright (c) 2020 setchi 4 | * Licensed under MIT (https://github.com/setchi/FancyScrollView/blob/master/LICENSE) 5 | */ 6 | 7 | using System; 8 | 9 | namespace FancyScrollView.Example07 10 | { 11 | class Context : FancyScrollRectContext 12 | { 13 | public int SelectedIndex = -1; 14 | public Action OnCellClicked; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/07_ScrollRect/Context.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 385da272f07574e22aba419d8d006a2d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/07_ScrollRect/Example07.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * FancyScrollView (https://github.com/setchi/FancyScrollView) 3 | * Copyright (c) 2020 setchi 4 | * Licensed under MIT (https://github.com/setchi/FancyScrollView/blob/master/LICENSE) 5 | */ 6 | 7 | using System; 8 | using System.Linq; 9 | using UnityEngine; 10 | using UnityEngine.UI; 11 | using EasingCore; 12 | 13 | namespace FancyScrollView.Example07 14 | { 15 | class Example07 : MonoBehaviour 16 | { 17 | [SerializeField] ScrollView scrollView = default; 18 | [SerializeField] InputField paddingTopInputField = default; 19 | [SerializeField] InputField paddingBottomInputField = default; 20 | [SerializeField] InputField spacingInputField = default; 21 | [SerializeField] InputField dataCountInputField = default; 22 | [SerializeField] InputField selectIndexInputField = default; 23 | [SerializeField] Dropdown alignmentDropdown = default; 24 | 25 | void Start() 26 | { 27 | scrollView.OnCellClicked(index => selectIndexInputField.text = index.ToString()); 28 | 29 | paddingTopInputField.onValueChanged.AddListener(_ => 30 | TryParseValue(paddingTopInputField, 0, 999, value => scrollView.PaddingTop = value)); 31 | paddingTopInputField.text = scrollView.PaddingTop.ToString(); 32 | 33 | paddingBottomInputField.onValueChanged.AddListener(_ => 34 | TryParseValue(paddingBottomInputField, 0, 999, value => scrollView.PaddingBottom = value)); 35 | paddingBottomInputField.text = scrollView.PaddingBottom.ToString(); 36 | 37 | spacingInputField.onValueChanged.AddListener(_ => 38 | TryParseValue(spacingInputField, 0, 100, value => scrollView.Spacing = value)); 39 | spacingInputField.text = scrollView.Spacing.ToString(); 40 | 41 | alignmentDropdown.AddOptions(Enum.GetNames(typeof(Alignment)).Select(x => new Dropdown.OptionData(x)).ToList()); 42 | alignmentDropdown.onValueChanged.AddListener(_ => SelectCell()); 43 | alignmentDropdown.value = (int)Alignment.Middle; 44 | 45 | selectIndexInputField.onValueChanged.AddListener(_ => SelectCell()); 46 | selectIndexInputField.text = "10"; 47 | 48 | dataCountInputField.onValueChanged.AddListener(_ => 49 | TryParseValue(dataCountInputField, 1, 99999, GenerateCells)); 50 | dataCountInputField.text = "20"; 51 | 52 | scrollView.JumpTo(10); 53 | } 54 | 55 | void TryParseValue(InputField inputField, int min, int max, Action success) 56 | { 57 | if (!int.TryParse(inputField.text, out int value)) 58 | { 59 | return; 60 | } 61 | 62 | if (value < min || value > max) 63 | { 64 | inputField.text = Mathf.Clamp(value, min, max).ToString(); 65 | return; 66 | } 67 | 68 | success(value); 69 | } 70 | 71 | void SelectCell() 72 | { 73 | if (scrollView.DataCount == 0) 74 | { 75 | return; 76 | } 77 | 78 | TryParseValue(selectIndexInputField, 0, scrollView.DataCount - 1, index => 79 | scrollView.ScrollTo(index, 0.3f, Ease.InOutQuint, (Alignment)alignmentDropdown.value)); 80 | } 81 | 82 | void GenerateCells(int dataCount) 83 | { 84 | var items = Enumerable.Range(0, dataCount) 85 | .Select(i => new ItemData($"Cell {i}")) 86 | .ToArray(); 87 | 88 | scrollView.UpdateData(items); 89 | SelectCell(); 90 | } 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/07_ScrollRect/Example07.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5822720e245a346c180e6738f4713e86 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/07_ScrollRect/ItemData.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * FancyScrollView (https://github.com/setchi/FancyScrollView) 3 | * Copyright (c) 2020 setchi 4 | * Licensed under MIT (https://github.com/setchi/FancyScrollView/blob/master/LICENSE) 5 | */ 6 | 7 | namespace FancyScrollView.Example07 8 | { 9 | class ItemData 10 | { 11 | public string Message { get; } 12 | 13 | public ItemData(string message) 14 | { 15 | Message = message; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/07_ScrollRect/ItemData.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 502c299ec3d7d4ee1943ea867b12439a 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/07_ScrollRect/ScrollView.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * FancyScrollView (https://github.com/setchi/FancyScrollView) 3 | * Copyright (c) 2020 setchi 4 | * Licensed under MIT (https://github.com/setchi/FancyScrollView/blob/master/LICENSE) 5 | */ 6 | 7 | using System; 8 | using System.Collections.Generic; 9 | using UnityEngine; 10 | using EasingCore; 11 | 12 | namespace FancyScrollView.Example07 13 | { 14 | class ScrollView : FancyScrollRect 15 | { 16 | [SerializeField] float cellSize = 100f; 17 | [SerializeField] GameObject cellPrefab = default; 18 | 19 | protected override float CellSize => cellSize; 20 | protected override GameObject CellPrefab => cellPrefab; 21 | public int DataCount => ItemsSource.Count; 22 | 23 | public float PaddingTop 24 | { 25 | get => paddingHead; 26 | set 27 | { 28 | paddingHead = value; 29 | Relayout(); 30 | } 31 | } 32 | 33 | public float PaddingBottom 34 | { 35 | get => paddingTail; 36 | set 37 | { 38 | paddingTail = value; 39 | Relayout(); 40 | } 41 | } 42 | 43 | public float Spacing 44 | { 45 | get => spacing; 46 | set 47 | { 48 | spacing = value; 49 | Relayout(); 50 | } 51 | } 52 | 53 | public void OnCellClicked(Action callback) 54 | { 55 | Context.OnCellClicked = callback; 56 | } 57 | 58 | public void UpdateData(IList items) 59 | { 60 | UpdateContents(items); 61 | } 62 | 63 | public void ScrollTo(int index, float duration, Ease easing, Alignment alignment = Alignment.Middle) 64 | { 65 | UpdateSelection(index); 66 | ScrollTo(index, duration, easing, GetAlignment(alignment)); 67 | } 68 | 69 | public void JumpTo(int index, Alignment alignment = Alignment.Middle) 70 | { 71 | UpdateSelection(index); 72 | JumpTo(index, GetAlignment(alignment)); 73 | } 74 | 75 | float GetAlignment(Alignment alignment) 76 | { 77 | switch (alignment) 78 | { 79 | case Alignment.Upper: return 0.0f; 80 | case Alignment.Middle: return 0.5f; 81 | case Alignment.Lower: return 1.0f; 82 | default: return GetAlignment(Alignment.Middle); 83 | } 84 | } 85 | 86 | void UpdateSelection(int index) 87 | { 88 | if (Context.SelectedIndex == index) 89 | { 90 | return; 91 | } 92 | 93 | Context.SelectedIndex = index; 94 | Refresh(); 95 | } 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/07_ScrollRect/ScrollView.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: edf2116e61aae4a38bc9be5652078992 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/08_GridView.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4b893ef841144432caaaaedb50562d18 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/08_GridView/Alignment.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * FancyScrollView (https://github.com/setchi/FancyScrollView) 3 | * Copyright (c) 2020 setchi 4 | * Licensed under MIT (https://github.com/setchi/FancyScrollView/blob/master/LICENSE) 5 | */ 6 | 7 | namespace FancyScrollView.Example08 8 | { 9 | enum Alignment 10 | { 11 | Upper, 12 | Middle, 13 | Lower, 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/08_GridView/Alignment.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c235795006bf34d43b8333c6f19435e2 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/08_GridView/Cell.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * FancyScrollView (https://github.com/setchi/FancyScrollView) 3 | * Copyright (c) 2020 setchi 4 | * Licensed under MIT (https://github.com/setchi/FancyScrollView/blob/master/LICENSE) 5 | */ 6 | 7 | using UnityEngine; 8 | using UnityEngine.UI; 9 | 10 | namespace FancyScrollView.Example08 11 | { 12 | class Cell : FancyGridViewCell 13 | { 14 | [SerializeField] Text message = default; 15 | [SerializeField] Image image = default; 16 | [SerializeField] Button button = default; 17 | 18 | public override void Initialize() 19 | { 20 | button.onClick.AddListener(() => Context.OnCellClicked?.Invoke(Index)); 21 | } 22 | 23 | public override void UpdateContent(ItemData itemData) 24 | { 25 | message.text = itemData.Index.ToString(); 26 | 27 | var selected = Context.SelectedIndex == Index; 28 | image.color = selected 29 | ? new Color32(0, 255, 255, 100) 30 | : new Color32(255, 255, 255, 77); 31 | } 32 | 33 | protected override void UpdatePosition(float normalizedPosition, float localPosition) 34 | { 35 | base.UpdatePosition(normalizedPosition, localPosition); 36 | 37 | var wave = Mathf.Sin(normalizedPosition * Mathf.PI * 2) * 65; 38 | transform.localPosition += Vector3.right * wave; 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/08_GridView/Cell.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 26d7b4e0c6ef240f98573f2097de52d4 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/08_GridView/Cell.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c3da64c29ae8a4e61a6bd072bad4e392 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/08_GridView/Context.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * FancyScrollView (https://github.com/setchi/FancyScrollView) 3 | * Copyright (c) 2020 setchi 4 | * Licensed under MIT (https://github.com/setchi/FancyScrollView/blob/master/LICENSE) 5 | */ 6 | 7 | using System; 8 | 9 | namespace FancyScrollView.Example08 10 | { 11 | class Context : FancyGridViewContext 12 | { 13 | public int SelectedIndex = -1; 14 | public Action OnCellClicked; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/08_GridView/Context.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5d22832e3764c43bfa52357c6967ee21 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/08_GridView/Example08.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * FancyScrollView (https://github.com/setchi/FancyScrollView) 3 | * Copyright (c) 2020 setchi 4 | * Licensed under MIT (https://github.com/setchi/FancyScrollView/blob/master/LICENSE) 5 | */ 6 | 7 | using System; 8 | using System.Linq; 9 | using UnityEngine; 10 | using UnityEngine.UI; 11 | using EasingCore; 12 | 13 | namespace FancyScrollView.Example08 14 | { 15 | class Example08 : MonoBehaviour 16 | { 17 | [SerializeField] GridView gridView = default; 18 | [SerializeField] InputField paddingTopInputField = default; 19 | [SerializeField] InputField paddingBottomInputField = default; 20 | [SerializeField] InputField xSpacingInputField = default; 21 | [SerializeField] InputField ySpacingInputField = default; 22 | [SerializeField] InputField dataCountInputField = default; 23 | [SerializeField] InputField selectIndexInputField = default; 24 | [SerializeField] Dropdown alignmentDropdown = default; 25 | 26 | void Start() 27 | { 28 | gridView.OnCellClicked(index => selectIndexInputField.text = index.ToString()); 29 | 30 | paddingTopInputField.onValueChanged.AddListener(_ => 31 | TryParseValue(paddingTopInputField, 0, 999, value => gridView.PaddingTop = value)); 32 | paddingTopInputField.text = gridView.PaddingTop.ToString(); 33 | 34 | paddingBottomInputField.onValueChanged.AddListener(_ => 35 | TryParseValue(paddingBottomInputField, 0, 999, value => gridView.PaddingBottom = value)); 36 | paddingBottomInputField.text = gridView.PaddingBottom.ToString(); 37 | 38 | xSpacingInputField.onValueChanged.AddListener(_ => 39 | TryParseValue(xSpacingInputField, 0, 99, value => gridView.SpacingX = value)); 40 | xSpacingInputField.text = gridView.SpacingX.ToString(); 41 | 42 | ySpacingInputField.onValueChanged.AddListener(_ => 43 | TryParseValue(ySpacingInputField, 0, 99, value => gridView.SpacingY = value)); 44 | ySpacingInputField.text = gridView.SpacingY.ToString(); 45 | 46 | alignmentDropdown.AddOptions(Enum.GetNames(typeof(Alignment)).Select(x => new Dropdown.OptionData(x)).ToList()); 47 | alignmentDropdown.onValueChanged.AddListener(_ => SelectCell()); 48 | alignmentDropdown.value = (int)Alignment.Middle; 49 | 50 | selectIndexInputField.onValueChanged.AddListener(_ => SelectCell()); 51 | selectIndexInputField.text = "50"; 52 | 53 | dataCountInputField.onValueChanged.AddListener(_ => 54 | TryParseValue(dataCountInputField, 1, 99999, GenerateCells)); 55 | dataCountInputField.text = "100"; 56 | 57 | gridView.JumpTo(50); 58 | } 59 | 60 | void TryParseValue(InputField inputField, int min, int max, Action success) 61 | { 62 | if (!int.TryParse(inputField.text, out int value)) 63 | { 64 | return; 65 | } 66 | 67 | if (value < min || value > max) 68 | { 69 | inputField.text = Mathf.Clamp(value, min, max).ToString(); 70 | return; 71 | } 72 | 73 | success(value); 74 | } 75 | 76 | void SelectCell() 77 | { 78 | if (gridView.DataCount == 0) 79 | { 80 | return; 81 | } 82 | 83 | TryParseValue(selectIndexInputField, 0, gridView.DataCount - 1, index => 84 | { 85 | gridView.UpdateSelection(index); 86 | gridView.ScrollTo(index, 0.4f, Ease.InOutQuint, (Alignment)alignmentDropdown.value); 87 | }); 88 | } 89 | 90 | void GenerateCells(int dataCount) 91 | { 92 | var items = Enumerable.Range(0, dataCount) 93 | .Select(i => new ItemData(i)) 94 | .ToArray(); 95 | 96 | gridView.UpdateContents(items); 97 | SelectCell(); 98 | } 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/08_GridView/Example08.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a6616f39929104255825a008596a7ab7 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/08_GridView/GridView.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * FancyScrollView (https://github.com/setchi/FancyScrollView) 3 | * Copyright (c) 2020 setchi 4 | * Licensed under MIT (https://github.com/setchi/FancyScrollView/blob/master/LICENSE) 5 | */ 6 | 7 | using System; 8 | using UnityEngine; 9 | using EasingCore; 10 | 11 | namespace FancyScrollView.Example08 12 | { 13 | class GridView : FancyGridView 14 | { 15 | class CellGroup : DefaultCellGroup { } 16 | 17 | [SerializeField] Cell cellPrefab = default; 18 | 19 | protected override void SetupCellTemplate() => Setup(cellPrefab); 20 | 21 | public float PaddingTop 22 | { 23 | get => paddingHead; 24 | set 25 | { 26 | paddingHead = value; 27 | Relayout(); 28 | } 29 | } 30 | 31 | public float PaddingBottom 32 | { 33 | get => paddingTail; 34 | set 35 | { 36 | paddingTail = value; 37 | Relayout(); 38 | } 39 | } 40 | 41 | public float SpacingY 42 | { 43 | get => spacing; 44 | set 45 | { 46 | spacing = value; 47 | Relayout(); 48 | } 49 | } 50 | 51 | public float SpacingX 52 | { 53 | get => startAxisSpacing; 54 | set 55 | { 56 | startAxisSpacing = value; 57 | Relayout(); 58 | } 59 | } 60 | 61 | public void UpdateSelection(int index) 62 | { 63 | if (Context.SelectedIndex == index) 64 | { 65 | return; 66 | } 67 | 68 | Context.SelectedIndex = index; 69 | Refresh(); 70 | } 71 | 72 | public void OnCellClicked(Action callback) 73 | { 74 | Context.OnCellClicked = callback; 75 | } 76 | 77 | public void ScrollTo(int index, float duration, Ease easing, Alignment alignment = Alignment.Middle) 78 | { 79 | UpdateSelection(index); 80 | ScrollTo(index, duration, easing, GetAlignment(alignment)); 81 | } 82 | 83 | public void JumpTo(int index, Alignment alignment = Alignment.Middle) 84 | { 85 | UpdateSelection(index); 86 | JumpTo(index, GetAlignment(alignment)); 87 | } 88 | 89 | float GetAlignment(Alignment alignment) 90 | { 91 | switch (alignment) 92 | { 93 | case Alignment.Upper: return 0.0f; 94 | case Alignment.Middle: return 0.5f; 95 | case Alignment.Lower: return 1.0f; 96 | default: return GetAlignment(Alignment.Middle); 97 | } 98 | } 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/08_GridView/GridView.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a5e61a71311864435b1d875fcb2dd1c9 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/08_GridView/ItemData.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * FancyScrollView (https://github.com/setchi/FancyScrollView) 3 | * Copyright (c) 2020 setchi 4 | * Licensed under MIT (https://github.com/setchi/FancyScrollView/blob/master/LICENSE) 5 | */ 6 | 7 | namespace FancyScrollView.Example08 8 | { 9 | class ItemData 10 | { 11 | public int Index { get; } 12 | 13 | public ItemData(int index) => Index = index; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/08_GridView/ItemData.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 28586d4140cb24767a02fc291261486d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/09_LoadTexture.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f547f5391557c4ef7a1e8831318a2aea 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/09_LoadTexture/Cell.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * FancyScrollView (https://github.com/setchi/FancyScrollView) 3 | * Copyright (c) 2020 setchi 4 | * Licensed under MIT (https://github.com/setchi/FancyScrollView/blob/master/LICENSE) 5 | */ 6 | 7 | using System.Linq; 8 | using UnityEngine; 9 | using UnityEngine.UI; 10 | using EasingCore; 11 | 12 | namespace FancyScrollView.Example09 13 | { 14 | class Cell : FancyCell 15 | { 16 | readonly EasingFunction alphaEasing = Easing.Get(Ease.OutQuint); 17 | 18 | [SerializeField] Text title = default; 19 | [SerializeField] Text description = default; 20 | [SerializeField] RawImage image = default; 21 | [SerializeField] Image background = default; 22 | [SerializeField] CanvasGroup canvasGroup = default; 23 | 24 | ItemData data; 25 | 26 | public override void UpdateContent(ItemData itemData) 27 | { 28 | data = itemData; 29 | image.texture = null; 30 | 31 | TextureLoader.Load(itemData.Url, result => 32 | { 33 | if (image == null || result.Url != data.Url) 34 | { 35 | return; 36 | } 37 | 38 | image.texture = result.Texture; 39 | }); 40 | 41 | title.text = itemData.Title; 42 | description.text = itemData.Description; 43 | 44 | UpdateSibling(); 45 | } 46 | 47 | void UpdateSibling() 48 | { 49 | var cells = transform.parent.Cast() 50 | .Select(t => t.GetComponent()) 51 | .Where(cell => cell.IsVisible); 52 | 53 | if (Index == cells.Min(x => x.Index)) 54 | { 55 | transform.SetAsLastSibling(); 56 | } 57 | 58 | if (Index == cells.Max(x => x.Index)) 59 | { 60 | transform.SetAsFirstSibling(); 61 | } 62 | } 63 | 64 | public override void UpdatePosition(float t) 65 | { 66 | const float popAngle = -15; 67 | const float slideAngle = 25; 68 | 69 | const float popSpan = 0.75f; 70 | const float slideSpan = 0.25f; 71 | 72 | t = 1f - t; 73 | 74 | var pop = Mathf.Min(popSpan, t) / popSpan; 75 | var slide = Mathf.Max(0, t - popSpan) / slideSpan; 76 | 77 | transform.localRotation = t < popSpan 78 | ? Quaternion.Euler(0, 0, popAngle * (1f - pop)) 79 | : Quaternion.Euler(0, 0, slideAngle * slide); 80 | 81 | transform.localPosition = Vector3.left * 500f * slide; 82 | 83 | canvasGroup.alpha = alphaEasing(1f - slide); 84 | 85 | background.color = Color.Lerp(Color.gray, Color.white, pop); 86 | } 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/09_LoadTexture/Cell.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 639b7c07323484160ac136e6dafd6922 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/09_LoadTexture/Cell.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3db7a6f4063f8407f9f656cde0e83a3b 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/09_LoadTexture/Example09.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * FancyScrollView (https://github.com/setchi/FancyScrollView) 3 | * Copyright (c) 2020 setchi 4 | * Licensed under MIT (https://github.com/setchi/FancyScrollView/blob/master/LICENSE) 5 | */ 6 | 7 | using UnityEngine; 8 | 9 | namespace FancyScrollView.Example09 10 | { 11 | class Example09 : MonoBehaviour 12 | { 13 | readonly ItemData[] itemData = 14 | { 15 | new ItemData( 16 | "FancyScrollView", 17 | "A scrollview component that can implement highly flexible animation.", 18 | "https://setchi.jp/FancyScrollView/09_LoadTexture/Images/00.png" 19 | ), 20 | new ItemData( 21 | "01_Basic", 22 | "Example of simplest implementation.", 23 | "https://setchi.jp/FancyScrollView/09_LoadTexture/Images/01.png" 24 | ), 25 | new ItemData( 26 | "02_FocusOn", 27 | "Example of focusing on the left and right cells with buttons.", 28 | "https://setchi.jp/FancyScrollView/09_LoadTexture/Images/02.png" 29 | ), 30 | new ItemData( 31 | "03_InfiniteScroll", 32 | "Example of infinite scroll implementation.", 33 | "https://setchi.jp/FancyScrollView/09_LoadTexture/Images/03.png" 34 | ), 35 | new ItemData( 36 | "04_Metaball", 37 | "Example of metaball implementation using shaders.", 38 | "https://setchi.jp/FancyScrollView/09_LoadTexture/Images/04.png" 39 | ), 40 | new ItemData( 41 | "05_Voronoi", 42 | "Example of voronoi implementation using shaders.", 43 | "https://setchi.jp/FancyScrollView/09_LoadTexture/Images/05.png" 44 | ), 45 | new ItemData( 46 | "06_LoopTabBar", 47 | "Example of switching screens with tabs.", 48 | "https://setchi.jp/FancyScrollView/09_LoadTexture/Images/06.png" 49 | ), 50 | new ItemData( 51 | "07_ScrollRect", 52 | "Example of ScrollRect style implementation with scroll bar.", 53 | "https://setchi.jp/FancyScrollView/09_LoadTexture/Images/07.png" 54 | ), 55 | new ItemData( 56 | "08_GridView", 57 | "Example of grid layout implementation.", 58 | "https://setchi.jp/FancyScrollView/09_LoadTexture/Images/08.png" 59 | ), 60 | new ItemData( 61 | "09_LoadTexture", 62 | "Example of load texture implementation.", 63 | "https://setchi.jp/FancyScrollView/09_LoadTexture/Images/09.png" 64 | ) 65 | }; 66 | 67 | [SerializeField] ScrollView scrollView = default; 68 | 69 | void Start() 70 | { 71 | scrollView.UpdateData(itemData); 72 | } 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/09_LoadTexture/Example09.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b951920e0903644939cc8df4fa5de0f6 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/09_LoadTexture/ItemData.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * FancyScrollView (https://github.com/setchi/FancyScrollView) 3 | * Copyright (c) 2020 setchi 4 | * Licensed under MIT (https://github.com/setchi/FancyScrollView/blob/master/LICENSE) 5 | */ 6 | 7 | namespace FancyScrollView.Example09 8 | { 9 | class ItemData 10 | { 11 | public string Title { get; } 12 | public string Description { get; } 13 | public string Url { get; } 14 | 15 | public ItemData(string title, string description, string url) 16 | { 17 | Title = title; 18 | Description = description; 19 | Url = url; 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/09_LoadTexture/ItemData.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8097aa762f66a4c0fbc02876a632f735 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/09_LoadTexture/ScrollView.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * FancyScrollView (https://github.com/setchi/FancyScrollView) 3 | * Copyright (c) 2020 setchi 4 | * Licensed under MIT (https://github.com/setchi/FancyScrollView/blob/master/LICENSE) 5 | */ 6 | 7 | using UnityEngine; 8 | using System.Collections.Generic; 9 | 10 | namespace FancyScrollView.Example09 11 | { 12 | class ScrollView : FancyScrollView 13 | { 14 | [SerializeField] Scroller scroller = default; 15 | [SerializeField] GameObject cellPrefab = default; 16 | 17 | protected override GameObject CellPrefab => cellPrefab; 18 | 19 | protected override void Initialize() 20 | { 21 | base.Initialize(); 22 | scroller.OnValueChanged(UpdatePosition); 23 | } 24 | 25 | public void UpdateData(IList items) 26 | { 27 | UpdateContents(items); 28 | scroller.SetTotalCount(items.Count); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/09_LoadTexture/ScrollView.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: eb9a70240d5de435e8ee58324cc164ab 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/09_LoadTexture/TextureLoader.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * FancyScrollView (https://github.com/setchi/FancyScrollView) 3 | * Copyright (c) 2020 setchi 4 | * Licensed under MIT (https://github.com/setchi/FancyScrollView/blob/master/LICENSE) 5 | */ 6 | 7 | using UnityEngine; 8 | using UnityEngine.Networking; 9 | using System; 10 | using System.Collections; 11 | using System.Collections.Generic; 12 | 13 | namespace FancyScrollView.Example09 14 | { 15 | static class TextureLoader 16 | { 17 | public static void Load(string url, Action<(string Url, Texture Texture)> onSuccess) => 18 | Loader.Instance.Load(url, onSuccess); 19 | 20 | class Loader : MonoBehaviour 21 | { 22 | readonly Dictionary cache = new Dictionary(); 23 | 24 | static Loader instance; 25 | 26 | public static Loader Instance => instance ?? 27 | (instance = FindObjectOfType() ?? 28 | new GameObject(typeof(TextureLoader).Name).AddComponent()); 29 | 30 | public void Load(string url, Action<(string Url, Texture Texture)> onSuccess) 31 | { 32 | if (cache.TryGetValue(url, out var cachedTexture)) 33 | { 34 | onSuccess((url, cachedTexture)); 35 | return; 36 | } 37 | 38 | StartCoroutine(DownloadTexture(url, result => 39 | { 40 | cache[result.Url] = result.Texture; 41 | onSuccess(result); 42 | })); 43 | } 44 | 45 | IEnumerator DownloadTexture(string url, Action<(string Url, Texture Texture)> onSuccess) 46 | { 47 | using (var request = UnityWebRequestTexture.GetTexture(url)) 48 | { 49 | yield return request.SendWebRequest(); 50 | 51 | if (request.isNetworkError) 52 | { 53 | Debug.LogErrorFormat("Error: {0}", request.error); 54 | yield break; 55 | } 56 | 57 | onSuccess(( 58 | url, 59 | ((DownloadHandlerTexture) request.downloadHandler).texture 60 | )); 61 | } 62 | } 63 | 64 | void OnDestroy() 65 | { 66 | foreach (var kv in cache) 67 | { 68 | Destroy(kv.Value); 69 | } 70 | 71 | instance = null; 72 | } 73 | } 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/09_LoadTexture/TextureLoader.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ce9d0bc0a1b0e4ef6a5e0f52961d5e9b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/Common.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cd36c087e1b9f4438a35ef5e5359cab9 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/Common/CellIn.anim: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!74 &7400000 4 | AnimationClip: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_Name: CellIn 10 | serializedVersion: 6 11 | m_Legacy: 0 12 | m_Compressed: 0 13 | m_UseHighQualityCurve: 1 14 | m_RotationCurves: [] 15 | m_CompressedRotationCurves: [] 16 | m_EulerCurves: [] 17 | m_PositionCurves: [] 18 | m_ScaleCurves: 19 | - curve: 20 | serializedVersion: 2 21 | m_Curve: 22 | - serializedVersion: 3 23 | time: 0 24 | value: {x: 1, y: 1, z: 1} 25 | inSlope: {x: 0, y: 0, z: 0} 26 | outSlope: {x: 0, y: 0, z: 0} 27 | tangentMode: 0 28 | weightedMode: 0 29 | inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} 30 | outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} 31 | - serializedVersion: 3 32 | time: 0.16666667 33 | value: {x: 1.3, y: 1.3, z: 1} 34 | inSlope: {x: 0, y: 0, z: 0} 35 | outSlope: {x: 0, y: 0, z: 0} 36 | tangentMode: 0 37 | weightedMode: 0 38 | inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} 39 | outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} 40 | m_PreInfinity: 2 41 | m_PostInfinity: 2 42 | m_RotationOrder: 4 43 | path: Text 44 | m_FloatCurves: [] 45 | m_PPtrCurves: [] 46 | m_SampleRate: 60 47 | m_WrapMode: 0 48 | m_Bounds: 49 | m_Center: {x: 0, y: 0, z: 0} 50 | m_Extent: {x: 0, y: 0, z: 0} 51 | m_ClipBindingConstant: 52 | genericBindings: 53 | - serializedVersion: 2 54 | path: 2612594937 55 | attribute: 3 56 | script: {fileID: 0} 57 | typeID: 4 58 | customType: 0 59 | isPPtrCurve: 0 60 | pptrCurveMapping: [] 61 | m_AnimationClipSettings: 62 | serializedVersion: 2 63 | m_AdditiveReferencePoseClip: {fileID: 0} 64 | m_AdditiveReferencePoseTime: 0 65 | m_StartTime: 0 66 | m_StopTime: 0.16666667 67 | m_OrientationOffsetY: 0 68 | m_Level: 0 69 | m_CycleOffset: 0 70 | m_HasAdditiveReferencePose: 0 71 | m_LoopTime: 0 72 | m_LoopBlend: 0 73 | m_LoopBlendOrientation: 0 74 | m_LoopBlendPositionY: 0 75 | m_LoopBlendPositionXZ: 0 76 | m_KeepOriginalOrientation: 0 77 | m_KeepOriginalPositionY: 1 78 | m_KeepOriginalPositionXZ: 0 79 | m_HeightFromFeet: 0 80 | m_Mirror: 0 81 | m_EditorCurves: 82 | - curve: 83 | serializedVersion: 2 84 | m_Curve: 85 | - serializedVersion: 3 86 | time: 0 87 | value: 1 88 | inSlope: 0 89 | outSlope: 0 90 | tangentMode: 136 91 | weightedMode: 0 92 | inWeight: 0.33333334 93 | outWeight: 0.33333334 94 | - serializedVersion: 3 95 | time: 0.16666667 96 | value: 1.3 97 | inSlope: 0 98 | outSlope: 0 99 | tangentMode: 136 100 | weightedMode: 0 101 | inWeight: 0.33333334 102 | outWeight: 0.33333334 103 | m_PreInfinity: 2 104 | m_PostInfinity: 2 105 | m_RotationOrder: 4 106 | attribute: m_LocalScale.x 107 | path: Text 108 | classID: 224 109 | script: {fileID: 0} 110 | - curve: 111 | serializedVersion: 2 112 | m_Curve: 113 | - serializedVersion: 3 114 | time: 0 115 | value: 1 116 | inSlope: 0 117 | outSlope: 0 118 | tangentMode: 136 119 | weightedMode: 0 120 | inWeight: 0.33333334 121 | outWeight: 0.33333334 122 | - serializedVersion: 3 123 | time: 0.16666667 124 | value: 1.3 125 | inSlope: 0 126 | outSlope: 0 127 | tangentMode: 136 128 | weightedMode: 0 129 | inWeight: 0.33333334 130 | outWeight: 0.33333334 131 | m_PreInfinity: 2 132 | m_PostInfinity: 2 133 | m_RotationOrder: 4 134 | attribute: m_LocalScale.y 135 | path: Text 136 | classID: 224 137 | script: {fileID: 0} 138 | - curve: 139 | serializedVersion: 2 140 | m_Curve: 141 | - serializedVersion: 3 142 | time: 0 143 | value: 1 144 | inSlope: 0 145 | outSlope: 0 146 | tangentMode: 136 147 | weightedMode: 0 148 | inWeight: 0.33333334 149 | outWeight: 0.33333334 150 | - serializedVersion: 3 151 | time: 0.16666667 152 | value: 1 153 | inSlope: 0 154 | outSlope: 0 155 | tangentMode: 136 156 | weightedMode: 0 157 | inWeight: 0.33333334 158 | outWeight: 0.33333334 159 | m_PreInfinity: 2 160 | m_PostInfinity: 2 161 | m_RotationOrder: 4 162 | attribute: m_LocalScale.z 163 | path: Text 164 | classID: 224 165 | script: {fileID: 0} 166 | m_EulerEditorCurves: [] 167 | m_HasGenericRootTransform: 0 168 | m_HasMotionFloatCurves: 0 169 | m_Events: [] 170 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/Common/CellIn.anim.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6119c8687f1ca4f10a81b016ad73ec54 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 7400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/Common/CellOut.anim.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c342edd1751924765857fce18798eed5 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 7400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/Common/CellSelect.controller.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cf854a03d7a804323a6252c418b6672f 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 9100000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/Common/Common.cginc: -------------------------------------------------------------------------------- 1 | float2 _Resolution; 2 | 3 | float2 ui_coord(float2 uv) 4 | { 5 | uv -= 0.5; 6 | uv *= _Resolution; 7 | return uv; 8 | } 9 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/Common/Common.cginc.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9981a25fe8a174b1682eded7e11b579e 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/Common/Dropdown.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a5f73e63b9cf5418ca91edef13ad6686 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/Common/ScenesDropdown.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * FancyScrollView (https://github.com/setchi/FancyScrollView) 3 | * Copyright (c) 2020 setchi 4 | * Licensed under MIT (https://github.com/setchi/FancyScrollView/blob/master/LICENSE) 5 | */ 6 | 7 | using System; 8 | using System.Linq; 9 | using UnityEngine; 10 | using UnityEngine.UI; 11 | using UnityEngine.SceneManagement; 12 | 13 | namespace FancyScrollView 14 | { 15 | [RequireComponent(typeof(Dropdown))] 16 | class ScenesDropdown : MonoBehaviour 17 | { 18 | readonly string[] scenes = 19 | { 20 | "01_Basic", 21 | "02_FocusOn", 22 | "03_InfiniteScroll", 23 | "04_Metaball", 24 | "05_Voronoi", 25 | "06_LoopTabBar", 26 | "07_ScrollRect", 27 | "08_GridView", 28 | "09_LoadTexture" 29 | }; 30 | 31 | void Start() 32 | { 33 | var dropdown = GetComponent(); 34 | dropdown.AddOptions(scenes.Select(x => new Dropdown.OptionData(x)).ToList()); 35 | dropdown.value = Mathf.Max(0, Array.IndexOf(scenes, SceneManager.GetActiveScene().name)); 36 | dropdown.onValueChanged.AddListener(value => 37 | SceneManager.LoadScene(scenes[value], LoadSceneMode.Single)); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Examples/Sources/Common/ScenesDropdown.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3235229a323914d85b82d72d9f51be02 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Sources.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d19ac89da996d1843aafe828e87e81ac 3 | folderAsset: yes 4 | timeCreated: 1487434893 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Sources/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3b7adbc21b737494d970fcbd5dbe1175 3 | folderAsset: yes 4 | timeCreated: 1508699670 5 | licenseType: Pro 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Sources/Editor/FancyScrollView.Editor.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "FancyScrollView.Editor", 3 | "references": [ 4 | "FancyScrollView" 5 | ], 6 | "optionalUnityReferences": [], 7 | "includePlatforms": [ 8 | "Editor" 9 | ], 10 | "excludePlatforms": [], 11 | "allowUnsafeCode": false, 12 | "overrideReferences": false, 13 | "precompiledReferences": [], 14 | "autoReferenced": true, 15 | "defineConstraints": [] 16 | } -------------------------------------------------------------------------------- /Assets/FancyScrollView/Sources/Editor/FancyScrollView.Editor.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 310eb4609be1c41459e5ebb1bde5ac5a 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Sources/Editor/ScrollerEditor.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * FancyScrollView (https://github.com/setchi/FancyScrollView) 3 | * Copyright (c) 2020 setchi 4 | * Licensed under MIT (https://github.com/setchi/FancyScrollView/blob/master/LICENSE) 5 | */ 6 | 7 | using UnityEditor; 8 | using UnityEditor.AnimatedValues; 9 | 10 | // For manteinance, every new [SerializeField] variable in Scroller must be declared here 11 | 12 | namespace FancyScrollView 13 | { 14 | [CustomEditor(typeof(Scroller))] 15 | [CanEditMultipleObjects] 16 | public class ScrollerEditor : Editor 17 | { 18 | SerializedProperty viewport; 19 | SerializedProperty scrollDirection; 20 | SerializedProperty movementType; 21 | SerializedProperty elasticity; 22 | SerializedProperty scrollSensitivity; 23 | SerializedProperty inertia; 24 | SerializedProperty decelerationRate; 25 | SerializedProperty snap; 26 | SerializedProperty draggable; 27 | SerializedProperty scrollbar; 28 | 29 | AnimBool showElasticity; 30 | AnimBool showInertiaRelatedValues; 31 | 32 | void OnEnable() 33 | { 34 | viewport = serializedObject.FindProperty("viewport"); 35 | scrollDirection = serializedObject.FindProperty("scrollDirection"); 36 | movementType = serializedObject.FindProperty("movementType"); 37 | elasticity = serializedObject.FindProperty("elasticity"); 38 | scrollSensitivity = serializedObject.FindProperty("scrollSensitivity"); 39 | inertia = serializedObject.FindProperty("inertia"); 40 | decelerationRate = serializedObject.FindProperty("decelerationRate"); 41 | snap = serializedObject.FindProperty("snap"); 42 | draggable = serializedObject.FindProperty("draggable"); 43 | scrollbar = serializedObject.FindProperty("scrollbar"); 44 | 45 | showElasticity = new AnimBool(Repaint); 46 | showInertiaRelatedValues = new AnimBool(Repaint); 47 | SetAnimBools(true); 48 | } 49 | 50 | void OnDisable() 51 | { 52 | showElasticity.valueChanged.RemoveListener(Repaint); 53 | showInertiaRelatedValues.valueChanged.RemoveListener(Repaint); 54 | } 55 | 56 | void SetAnimBools(bool instant) 57 | { 58 | SetAnimBool(showElasticity, !movementType.hasMultipleDifferentValues && movementType.enumValueIndex == (int)MovementType.Elastic, instant); 59 | SetAnimBool(showInertiaRelatedValues, !inertia.hasMultipleDifferentValues && inertia.boolValue, instant); 60 | } 61 | 62 | void SetAnimBool(AnimBool a, bool value, bool instant) 63 | { 64 | if (instant) 65 | { 66 | a.value = value; 67 | } 68 | else 69 | { 70 | a.target = value; 71 | } 72 | } 73 | 74 | public override void OnInspectorGUI() 75 | { 76 | SetAnimBools(false); 77 | 78 | serializedObject.Update(); 79 | EditorGUILayout.PropertyField(viewport); 80 | EditorGUILayout.PropertyField(scrollDirection); 81 | EditorGUILayout.PropertyField(movementType); 82 | DrawMovementTypeRelatedValue(); 83 | EditorGUILayout.PropertyField(scrollSensitivity); 84 | EditorGUILayout.PropertyField(inertia); 85 | DrawInertiaRelatedValues(); 86 | EditorGUILayout.PropertyField(draggable); 87 | EditorGUILayout.PropertyField(scrollbar); 88 | serializedObject.ApplyModifiedProperties(); 89 | } 90 | 91 | void DrawMovementTypeRelatedValue() 92 | { 93 | using (var group = new EditorGUILayout.FadeGroupScope(showElasticity.faded)) 94 | { 95 | if (!group.visible) 96 | { 97 | return; 98 | } 99 | 100 | using (new EditorGUI.IndentLevelScope()) 101 | { 102 | EditorGUILayout.PropertyField(elasticity); 103 | } 104 | } 105 | } 106 | 107 | void DrawInertiaRelatedValues() 108 | { 109 | using (var group = new EditorGUILayout.FadeGroupScope(showInertiaRelatedValues.faded)) 110 | { 111 | if (!group.visible) 112 | { 113 | return; 114 | } 115 | 116 | using (new EditorGUI.IndentLevelScope()) 117 | { 118 | EditorGUILayout.PropertyField(decelerationRate); 119 | EditorGUILayout.PropertyField(snap); 120 | } 121 | } 122 | } 123 | } 124 | } 125 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Sources/Editor/ScrollerEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 986fda6476737da458576709b7f59ea3 3 | timeCreated: 1508699683 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/FancyScrollView/Sources/Runtime.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dd41a20ffdea64364905efac7fb4aa9b 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Sources/Runtime/Core.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: aca07f0cadcbc467ca910639faf19bd9 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Sources/Runtime/Core/FancyCell.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * FancyScrollView (https://github.com/setchi/FancyScrollView) 3 | * Copyright (c) 2020 setchi 4 | * Licensed under MIT (https://github.com/setchi/FancyScrollView/blob/master/LICENSE) 5 | */ 6 | 7 | using UnityEngine; 8 | 9 | namespace FancyScrollView 10 | { 11 | /// 12 | /// のセルを実装するための抽象基底クラス. 13 | /// が不要な場合は 14 | /// 代わりに を使用します. 15 | /// 16 | /// アイテムのデータ型. 17 | /// の型. 18 | public abstract class FancyCell : MonoBehaviour where TContext : class, new() 19 | { 20 | /// 21 | /// このセルで表示しているデータのインデックス. 22 | /// 23 | public int Index { get; set; } = -1; 24 | 25 | /// 26 | /// このセルの可視状態. 27 | /// 28 | public virtual bool IsVisible => gameObject.activeSelf; 29 | 30 | /// 31 | /// の参照. 32 | /// セルとスクロールビュー間で同じインスタンスが共有されます. 情報の受け渡しや状態の保持に使用します. 33 | /// 34 | protected TContext Context { get; private set; } 35 | 36 | /// 37 | /// をセットします. 38 | /// 39 | /// コンテキスト. 40 | public virtual void SetContext(TContext context) => Context = context; 41 | 42 | /// 43 | /// 初期化を行います. 44 | /// 45 | public virtual void Initialize() { } 46 | 47 | /// 48 | /// このセルの可視状態を設定します. 49 | /// 50 | /// 可視状態なら true, 非可視状態なら false. 51 | public virtual void SetVisible(bool visible) => gameObject.SetActive(visible); 52 | 53 | /// 54 | /// アイテムデータに基づいてこのセルの表示内容を更新します. 55 | /// 56 | /// アイテムデータ. 57 | public abstract void UpdateContent(TItemData itemData); 58 | 59 | /// 60 | /// 0.0f ~ 1.0f の値に基づいてこのセルのスクロール位置を更新します. 61 | /// 62 | /// ビューポート範囲の正規化されたスクロール位置. 63 | public abstract void UpdatePosition(float position); 64 | } 65 | 66 | /// 67 | /// のセルを実装するための抽象基底クラス. 68 | /// 69 | /// アイテムのデータ型. 70 | /// 71 | public abstract class FancyCell : FancyCell 72 | { 73 | /// 74 | public sealed override void SetContext(NullContext context) => base.SetContext(context); 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Sources/Runtime/Core/FancyCell.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 23e073f093082c6449696d1199adc881 3 | timeCreated: 1487183338 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Sources/Runtime/Core/FancyScrollView.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e5a78e3955a0bca4593487fdd78cf2d4 3 | timeCreated: 1487183318 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Sources/Runtime/FancyScrollView.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "FancyScrollView" 3 | } 4 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Sources/Runtime/FancyScrollView.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 59f6770f7492c42ff827a64ac010ac49 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Sources/Runtime/GridView.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c7768f2982b0142ab876d2bb4b597646 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Sources/Runtime/GridView/FancyCellGroup.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * FancyScrollView (https://github.com/setchi/FancyScrollView) 3 | * Copyright (c) 2020 setchi 4 | * Licensed under MIT (https://github.com/setchi/FancyScrollView/blob/master/LICENSE) 5 | */ 6 | 7 | using UnityEngine; 8 | using System.Linq; 9 | 10 | namespace FancyScrollView 11 | { 12 | /// 13 | /// 複数の を持つセルグループ実装するための抽象基底クラス. 14 | /// 15 | /// アイテムのデータ型. 16 | /// の型. 17 | public abstract class FancyCellGroup : FancyCell 18 | where TContext : class, IFancyCellGroupContext, new() 19 | { 20 | /// 21 | /// このグループで表示するセルの配列. 22 | /// 23 | protected virtual FancyCell[] Cells { get; private set; } 24 | 25 | /// 26 | /// このグループで表示するセルの配列をインスタンス化します. 27 | /// 28 | /// このグループで表示するセルの配列. 29 | protected virtual FancyCell[] InstantiateCells() 30 | { 31 | return Enumerable.Range(0, Context.GetGroupCount()) 32 | .Select(_ => Instantiate(Context.CellTemplate, transform)) 33 | .Select(x => x.GetComponent>()) 34 | .ToArray(); 35 | } 36 | 37 | /// 38 | public override void Initialize() 39 | { 40 | Cells = InstantiateCells(); 41 | Debug.Assert(Cells.Length == Context.GetGroupCount()); 42 | 43 | for (var i = 0; i < Cells.Length; i++) 44 | { 45 | Cells[i].SetContext(Context); 46 | Cells[i].Initialize(); 47 | } 48 | } 49 | 50 | /// 51 | public override void UpdateContent(TItemData[] contents) 52 | { 53 | var firstCellIndex = Index * Context.GetGroupCount(); 54 | 55 | for (var i = 0; i < Cells.Length; i++) 56 | { 57 | Cells[i].Index = i + firstCellIndex; 58 | Cells[i].SetVisible(i < contents.Length); 59 | 60 | if (Cells[i].IsVisible) 61 | { 62 | Cells[i].UpdateContent(contents[i]); 63 | } 64 | } 65 | } 66 | 67 | /// 68 | public override void UpdatePosition(float position) 69 | { 70 | for (var i = 0; i < Cells.Length; i++) 71 | { 72 | Cells[i].UpdatePosition(position); 73 | } 74 | } 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Sources/Runtime/GridView/FancyCellGroup.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 84300901ad8704c11b39587ed6d87468 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Sources/Runtime/GridView/FancyGridView.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e806c8d18b1ff45bb87e9a5b87ec85e3 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Sources/Runtime/GridView/FancyGridViewCell.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * FancyScrollView (https://github.com/setchi/FancyScrollView) 3 | * Copyright (c) 2020 setchi 4 | * Licensed under MIT (https://github.com/setchi/FancyScrollView/blob/master/LICENSE) 5 | */ 6 | 7 | using UnityEngine; 8 | 9 | namespace FancyScrollView 10 | { 11 | /// 12 | /// のセルを実装するための抽象基底クラス. 13 | /// が不要な場合は 14 | /// 代わりに を使用します. 15 | /// 16 | /// アイテムのデータ型. 17 | /// の型. 18 | public abstract class FancyGridViewCell : FancyScrollRectCell 19 | where TContext : class, IFancyGridViewContext, new() 20 | { 21 | /// 22 | protected override void UpdatePosition(float normalizedPosition, float localPosition) 23 | { 24 | var cellSize = Context.GetCellSize(); 25 | var spacing = Context.GetStartAxisSpacing(); 26 | var groupCount = Context.GetGroupCount(); 27 | 28 | var indexInGroup = Index % groupCount; 29 | var positionInGroup = (cellSize + spacing) * (indexInGroup - (groupCount - 1) * 0.5f); 30 | 31 | transform.localPosition = Context.ScrollDirection == ScrollDirection.Horizontal 32 | ? new Vector2(-localPosition, -positionInGroup) 33 | : new Vector2(positionInGroup, localPosition); 34 | } 35 | } 36 | 37 | /// 38 | /// のセルを実装するための抽象基底クラス. 39 | /// 40 | /// アイテムのデータ型. 41 | /// 42 | public abstract class FancyGridViewCell : FancyGridViewCell 43 | { 44 | /// 45 | public sealed override void SetContext(FancyGridViewContext context) => base.SetContext(context); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Sources/Runtime/GridView/FancyGridViewCell.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 129bb13f5b2b9435a93d53ca93471334 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Sources/Runtime/GridView/FancyGridViewContext.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * FancyScrollView (https://github.com/setchi/FancyScrollView) 3 | * Copyright (c) 2020 setchi 4 | * Licensed under MIT (https://github.com/setchi/FancyScrollView/blob/master/LICENSE) 5 | */ 6 | 7 | using System; 8 | using UnityEngine; 9 | 10 | namespace FancyScrollView 11 | { 12 | /// 13 | /// のコンテキスト基底クラス. 14 | /// 15 | public class FancyGridViewContext : IFancyGridViewContext 16 | { 17 | ScrollDirection IFancyScrollRectContext.ScrollDirection { get; set; } 18 | Func<(float ScrollSize, float ReuseMargin)> IFancyScrollRectContext.CalculateScrollSize { get; set; } 19 | GameObject IFancyCellGroupContext.CellTemplate { get; set; } 20 | Func IFancyCellGroupContext.GetGroupCount { get; set; } 21 | Func IFancyGridViewContext.GetStartAxisSpacing { get; set; } 22 | Func IFancyGridViewContext.GetCellSize { get; set; } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Sources/Runtime/GridView/FancyGridViewContext.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 954a17398bfb54ee7baac3d7ab7e822c 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Sources/Runtime/GridView/IFancyCellGroupContext.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * FancyScrollView (https://github.com/setchi/FancyScrollView) 3 | * Copyright (c) 2020 setchi 4 | * Licensed under MIT (https://github.com/setchi/FancyScrollView/blob/master/LICENSE) 5 | */ 6 | 7 | using System; 8 | using UnityEngine; 9 | 10 | namespace FancyScrollView 11 | { 12 | /// 13 | /// のコンテキストインターフェース. 14 | /// 15 | public interface IFancyCellGroupContext 16 | { 17 | GameObject CellTemplate { get; set; } 18 | Func GetGroupCount { get; set; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Sources/Runtime/GridView/IFancyCellGroupContext.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 213da42f7c9a347beaa56c5886c582a1 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Sources/Runtime/GridView/IFancyGridViewContext.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * FancyScrollView (https://github.com/setchi/FancyScrollView) 3 | * Copyright (c) 2020 setchi 4 | * Licensed under MIT (https://github.com/setchi/FancyScrollView/blob/master/LICENSE) 5 | */ 6 | 7 | using System; 8 | 9 | namespace FancyScrollView 10 | { 11 | /// 12 | /// のコンテキストインターフェース. 13 | /// 14 | public interface IFancyGridViewContext : IFancyScrollRectContext, IFancyCellGroupContext 15 | { 16 | Func GetStartAxisSpacing { get; set; } 17 | Func GetCellSize { get; set ; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Sources/Runtime/GridView/IFancyGridViewContext.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3cf2d53d9c81945c28f7c558a7c40ba3 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Sources/Runtime/ScrollRect.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e2c5beedd885c4490a86bb4973f965bf 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Sources/Runtime/ScrollRect/FancyScrollRect.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 66c8eb84fdbde4a4a8273b98227a282d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Sources/Runtime/ScrollRect/FancyScrollRectCell.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * FancyScrollView (https://github.com/setchi/FancyScrollView) 3 | * Copyright (c) 2020 setchi 4 | * Licensed under MIT (https://github.com/setchi/FancyScrollView/blob/master/LICENSE) 5 | */ 6 | 7 | using UnityEngine; 8 | 9 | namespace FancyScrollView 10 | { 11 | /// 12 | /// のセルを実装するための抽象基底クラス. 13 | /// が不要な場合は 14 | /// 代わりに を使用します. 15 | /// 16 | /// アイテムのデータ型. 17 | /// の型. 18 | public abstract class FancyScrollRectCell : FancyCell 19 | where TContext : class, IFancyScrollRectContext, new() 20 | { 21 | /// 22 | public override void UpdatePosition(float position) 23 | { 24 | var (scrollSize, reuseMargin) = Context.CalculateScrollSize(); 25 | 26 | var normalizedPosition = (Mathf.Lerp(0f, scrollSize, position) - reuseMargin) / (scrollSize - reuseMargin * 2f); 27 | 28 | var start = 0.5f * scrollSize; 29 | var end = -start; 30 | 31 | UpdatePosition(normalizedPosition, Mathf.Lerp(start, end, position)); 32 | } 33 | 34 | /// 35 | /// このセルの位置を更新します. 36 | /// 37 | /// 38 | /// ビューポートの範囲で正規化されたスクロール位置. 39 | /// の値に基づいて 40 | /// 0.0 ~ 1.0 の範囲を超えた値が渡されることがあります. 41 | /// 42 | /// ローカル位置. 43 | protected virtual void UpdatePosition(float normalizedPosition, float localPosition) 44 | { 45 | transform.localPosition = Context.ScrollDirection == ScrollDirection.Horizontal 46 | ? new Vector2(-localPosition, 0) 47 | : new Vector2(0, localPosition); 48 | } 49 | } 50 | 51 | /// 52 | /// のセルを実装するための抽象基底クラス. 53 | /// 54 | /// アイテムのデータ型. 55 | /// 56 | public abstract class FancyScrollRectCell : FancyScrollRectCell 57 | { 58 | /// 59 | public sealed override void SetContext(FancyScrollRectContext context) => base.SetContext(context); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Sources/Runtime/ScrollRect/FancyScrollRectCell.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 09f137a55810740eab42e24ef242dcfa 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Sources/Runtime/ScrollRect/FancyScrollRectContext.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * FancyScrollView (https://github.com/setchi/FancyScrollView) 3 | * Copyright (c) 2020 setchi 4 | * Licensed under MIT (https://github.com/setchi/FancyScrollView/blob/master/LICENSE) 5 | */ 6 | 7 | using System; 8 | 9 | namespace FancyScrollView 10 | { 11 | /// 12 | /// のコンテキスト基底クラス. 13 | /// 14 | public class FancyScrollRectContext : IFancyScrollRectContext 15 | { 16 | ScrollDirection IFancyScrollRectContext.ScrollDirection { get; set; } 17 | Func<(float ScrollSize, float ReuseMargin)> IFancyScrollRectContext.CalculateScrollSize { get; set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Sources/Runtime/ScrollRect/FancyScrollRectContext.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 91383bd46cee541a7a03e08cfaa47c16 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Sources/Runtime/ScrollRect/IFancyScrollRectContext.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * FancyScrollView (https://github.com/setchi/FancyScrollView) 3 | * Copyright (c) 2020 setchi 4 | * Licensed under MIT (https://github.com/setchi/FancyScrollView/blob/master/LICENSE) 5 | */ 6 | 7 | using System; 8 | 9 | namespace FancyScrollView 10 | { 11 | /// 12 | /// のコンテキストインターフェース. 13 | /// 14 | public interface IFancyScrollRectContext 15 | { 16 | ScrollDirection ScrollDirection { get; set; } 17 | Func<(float ScrollSize, float ReuseMargin)> CalculateScrollSize { get; set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Sources/Runtime/ScrollRect/IFancyScrollRectContext.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e425de6354b6946c7a3b9f2c807b60fe 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Sources/Runtime/Scroller.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 691a9f5ee4aec4112a01b9a4332cac51 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Sources/Runtime/Scroller/EasingCore.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3b2a35f9ff1c8487582b74620e380486 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Sources/Runtime/Scroller/MovementDirection.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * FancyScrollView (https://github.com/setchi/FancyScrollView) 3 | * Copyright (c) 2020 setchi 4 | * Licensed under MIT (https://github.com/setchi/FancyScrollView/blob/master/LICENSE) 5 | */ 6 | 7 | namespace FancyScrollView 8 | { 9 | public enum MovementDirection 10 | { 11 | Left, 12 | Right, 13 | Up, 14 | Down, 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Sources/Runtime/Scroller/MovementDirection.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 11769de5e972543c7a4132ceff94a5c4 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Sources/Runtime/Scroller/MovementType.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * FancyScrollView (https://github.com/setchi/FancyScrollView) 3 | * Copyright (c) 2020 setchi 4 | * Licensed under MIT (https://github.com/setchi/FancyScrollView/blob/master/LICENSE) 5 | */ 6 | 7 | using UnityEngine.UI; 8 | 9 | namespace FancyScrollView 10 | { 11 | public enum MovementType 12 | { 13 | Unrestricted = ScrollRect.MovementType.Unrestricted, 14 | Elastic = ScrollRect.MovementType.Elastic, 15 | Clamped = ScrollRect.MovementType.Clamped 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Sources/Runtime/Scroller/MovementType.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 585de8f4f272547c89041f94f2ad92b8 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Sources/Runtime/Scroller/ScrollDirection.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * FancyScrollView (https://github.com/setchi/FancyScrollView) 3 | * Copyright (c) 2020 setchi 4 | * Licensed under MIT (https://github.com/setchi/FancyScrollView/blob/master/LICENSE) 5 | */ 6 | 7 | namespace FancyScrollView 8 | { 9 | public enum ScrollDirection 10 | { 11 | Vertical, 12 | Horizontal, 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Sources/Runtime/Scroller/ScrollDirection.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3392a30c085c642139c92e94ec0d6309 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/FancyScrollView/Sources/Runtime/Scroller/Scroller.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9f0e995f494626a4f878eedbded37c8d 3 | timeCreated: 1487408581 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2020 setchi 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 | -------------------------------------------------------------------------------- /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_DisableAudio: 0 16 | m_VirtualizeEffects: 1 17 | -------------------------------------------------------------------------------- /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 | - enabled: 1 9 | path: Assets/FancyScrollView/Examples/01_Basic.unity 10 | guid: f5666b6c719a9b544ab322e1066aef5f 11 | - enabled: 1 12 | path: Assets/FancyScrollView/Examples/02_FocusOn.unity 13 | guid: ff644be2cb161904ba6ec037baf31ad1 14 | - enabled: 1 15 | path: Assets/FancyScrollView/Examples/03_InfiniteScroll.unity 16 | guid: 22d1be941599faf45b04ab4c6a2def09 17 | - enabled: 1 18 | path: Assets/FancyScrollView/Examples/04_Metaball.unity 19 | guid: 4f0f25a90e2674f75a24f6ea541c0a6c 20 | - enabled: 1 21 | path: Assets/FancyScrollView/Examples/05_Voronoi.unity 22 | guid: 9f4081131e0754ae184f905e3d995a98 23 | - enabled: 1 24 | path: Assets/FancyScrollView/Examples/06_LoopTabBar.unity 25 | guid: 58528ac4d9c36415ea90597e1199f2e4 26 | - enabled: 1 27 | path: Assets/FancyScrollView/Examples/07_ScrollRect.unity 28 | guid: 8d95738372cdc4d858b4c4c4f06d2db1 29 | - enabled: 1 30 | path: Assets/FancyScrollView/Examples/08_GridView.unity 31 | guid: 8441a013bef6d450aa8dc5de6207a233 32 | - enabled: 1 33 | path: Assets/FancyScrollView/Examples/09_LoadTexture.unity 34 | guid: eb8cb776d6776468eb0bec979e0c2010 35 | m_configObjects: {} 36 | -------------------------------------------------------------------------------- /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: 3 7 | m_ExternalVersionControlSupport: Visible Meta Files 8 | m_SerializationMode: 2 9 | m_DefaultBehaviorMode: 0 10 | m_SpritePackerMode: 2 11 | m_SpritePackerPaddingPower: 1 12 | m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd 13 | m_ProjectGenerationRootNamespace: 14 | m_UserGeneratedProjectSuffix: 15 | -------------------------------------------------------------------------------- /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 | - {fileID: 10782, guid: 0000000000000000f000000000000000, type: 0} 39 | - {fileID: 16000, guid: 0000000000000000f000000000000000, type: 0} 40 | - {fileID: 16001, guid: 0000000000000000f000000000000000, type: 0} 41 | - {fileID: 17000, guid: 0000000000000000f000000000000000, type: 0} 42 | m_PreloadedShaders: [] 43 | m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, 44 | type: 0} 45 | m_CustomRenderPipeline: {fileID: 0} 46 | m_TransparencySortMode: 0 47 | m_TransparencySortAxis: {x: 0, y: 0, z: 1} 48 | m_DefaultRenderingPath: 1 49 | m_DefaultMobileRenderingPath: 1 50 | m_TierSettings: [] 51 | m_LightmapStripping: 0 52 | m_FogStripping: 0 53 | m_InstancingStripping: 0 54 | m_LightmapKeepPlain: 1 55 | m_LightmapKeepDirCombined: 1 56 | m_LightmapKeepDynamicPlain: 1 57 | m_LightmapKeepDynamicDirCombined: 1 58 | m_LightmapKeepShadowMask: 1 59 | m_LightmapKeepSubtractive: 1 60 | m_FogKeepLinear: 1 61 | m_FogKeepExp: 1 62 | m_FogKeepExp2: 1 63 | m_AlbedoSwatchInfos: [] 64 | m_LightsUseLinearIntensity: 0 65 | m_LightsUseColorTemperature: 0 66 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1386491679 &1 4 | PresetManager: 5 | m_ObjectHideFlags: 0 6 | m_DefaultList: [] 7 | -------------------------------------------------------------------------------- /ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2019.4.7f1 2 | m_EditorVersionWithRevision: 2019.4.7f1 (e992b1a16e65) 3 | -------------------------------------------------------------------------------- /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 | serializedVersion: 1 7 | m_Enabled: 1 8 | m_TestMode: 0 9 | m_EventOldUrl: https://api.uca.cloud.unity3d.com/v1/events 10 | m_EventUrl: https://cdp.cloud.unity3d.com/v1/events 11 | m_ConfigUrl: https://config.uca.cloud.unity3d.com 12 | m_TestInitMode: 0 13 | CrashReportingSettings: 14 | m_EventUrl: https://perf-events.cloud.unity3d.com 15 | m_Enabled: 0 16 | m_LogBufferSize: 10 17 | m_CaptureEditorExceptions: 1 18 | UnityPurchasingSettings: 19 | m_Enabled: 0 20 | m_TestMode: 0 21 | UnityAnalyticsSettings: 22 | m_Enabled: 0 23 | m_TestMode: 0 24 | m_InitializeOnStartup: 1 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: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!937362698 &1 4 | VFXManager: 5 | m_ObjectHideFlags: 0 6 | m_IndirectShader: {fileID: 0} 7 | m_CopyBufferShader: {fileID: 0} 8 | m_SortShader: {fileID: 0} 9 | m_RenderPipeSettingsPath: 10 | m_FixedTimeStep: 0.016666668 11 | m_MaxDeltaTime: 0.05 12 | --------------------------------------------------------------------------------