├── .gitignore ├── Assets ├── Demo.meta ├── Demo │ ├── DemoScene.unity │ ├── DemoScene.unity.meta │ ├── Resources.meta │ ├── Resources │ │ ├── ScrollCell1.prefab │ │ ├── ScrollCell1.prefab.meta │ │ ├── ScrollCell2.prefab │ │ ├── ScrollCell2.prefab.meta │ │ ├── ScrollCell3.prefab │ │ └── ScrollCell3.prefab.meta │ ├── RoleCardsShow.unity │ ├── RoleCardsShow.unity.meta │ ├── ScaleScrollRect.unity │ ├── ScaleScrollRect.unity.meta │ ├── Scripts.meta │ └── Scripts │ │ ├── ScrollIndexCallback1.cs │ │ ├── ScrollIndexCallback1.cs.meta │ │ ├── ScrollIndexCallback2.cs │ │ ├── ScrollIndexCallback2.cs.meta │ │ ├── ScrollIndexCallback3.cs │ │ └── ScrollIndexCallback3.cs.meta ├── Resources.meta ├── Resources │ ├── Prefab.meta │ ├── Prefab │ │ ├── ImageCard.prefab │ │ ├── ImageCard.prefab.meta │ │ ├── RoleCard.prefab │ │ └── RoleCard.prefab.meta │ ├── Texture.meta │ └── Texture │ │ ├── RO_lv0.png │ │ ├── RO_lv0.png.meta │ │ ├── RO_lv120.png │ │ ├── RO_lv120.png.meta │ │ ├── UI_CardBG.png │ │ ├── UI_CardBG.png.meta │ │ ├── UI_Cardbg1.png │ │ ├── UI_Cardbg1.png.meta │ │ ├── card_bg_big_1.jpg │ │ ├── card_bg_big_1.jpg.meta │ │ ├── card_bg_big_2.jpg │ │ ├── card_bg_big_2.jpg.meta │ │ ├── card_bg_big_3.jpg │ │ ├── card_bg_big_3.jpg.meta │ │ ├── card_bg_big_4.jpg │ │ ├── card_bg_big_4.jpg.meta │ │ ├── card_bg_big_5.jpg │ │ ├── card_bg_big_5.jpg.meta │ │ ├── card_bg_big_6.jpg │ │ └── card_bg_big_6.jpg.meta ├── Scripts.meta ├── Scripts │ ├── AladdinScript.meta │ ├── AladdinScript │ │ ├── CFixGridRect.cs │ │ ├── CFixGridRect.cs.meta │ │ ├── CIgnoreRayCast.cs │ │ ├── CIgnoreRayCast.cs.meta │ │ ├── CPlayedCardOnDrag.cs │ │ ├── CPlayedCardOnDrag.cs.meta │ │ ├── CPlayedCardOnDrop.cs │ │ ├── CPlayedCardOnDrop.cs.meta │ │ ├── CUIPlayedCharCardWidget.cs │ │ ├── CUIPlayedCharCardWidget.cs.meta │ │ ├── CUIShowCardsPanel.cs │ │ └── CUIShowCardsPanel.cs.meta │ ├── EasyObjectPool.meta │ ├── EasyObjectPool │ │ ├── EasyObjectPool.cs │ │ ├── EasyObjectPool.cs.meta │ │ ├── PoolObject.cs │ │ ├── PoolObject.cs.meta │ │ ├── ResourceManager.cs │ │ └── ResourceManager.cs.meta │ ├── Editor.meta │ ├── Editor │ │ ├── LoopScrollRectInspector.cs │ │ ├── LoopScrollRectInspector.cs.meta │ │ ├── SGDefaultControls.cs │ │ ├── SGDefaultControls.cs.meta │ │ ├── SGMenuOptions.cs │ │ └── SGMenuOptions.cs.meta │ ├── EnhanceScrollView.meta │ ├── EnhanceScrollView │ │ ├── CDragOnCard.cs │ │ ├── CDragOnCard.cs.meta │ │ ├── EnhanceItem.cs │ │ ├── EnhanceItem.cs.meta │ │ ├── EnhanceShow.cs │ │ ├── EnhanceShow.cs.meta │ │ ├── EnhancelScrollView.cs │ │ └── EnhancelScrollView.cs.meta │ ├── InitOnStart.cs │ ├── InitOnStart.cs.meta │ ├── LoopHorizontalScrollRect.cs │ ├── LoopHorizontalScrollRect.cs.meta │ ├── LoopScrollRect.cs │ ├── LoopScrollRect.cs.meta │ ├── LoopVerticalScrollRect.cs │ └── LoopVerticalScrollRect.cs.meta ├── ThirdParty.meta └── ThirdParty │ ├── DOTween.meta │ └── DOTween │ ├── DOTween.XML │ ├── DOTween.XML.meta │ ├── DOTween.dll │ ├── DOTween.dll.mdb │ ├── DOTween.dll.mdb.meta │ ├── DOTween.dll.meta │ ├── DOTween43.dll │ ├── DOTween43.dll.mdb │ ├── DOTween43.dll.mdb.meta │ ├── DOTween43.dll.meta │ ├── DOTween43.xml │ ├── DOTween43.xml.meta │ ├── DOTween46.dll │ ├── DOTween46.dll.mdb │ ├── DOTween46.dll.mdb.meta │ ├── DOTween46.dll.meta │ ├── DOTween46.xml │ ├── DOTween46.xml.meta │ ├── DOTween50.dll │ ├── DOTween50.dll.mdb │ ├── DOTween50.dll.mdb.meta │ ├── DOTween50.dll.meta │ ├── DOTween50.xml │ ├── DOTween50.xml.meta │ ├── Editor.meta │ ├── Editor │ ├── DOTweenEditor.XML │ ├── DOTweenEditor.XML.meta │ ├── DOTweenEditor.dll │ ├── DOTweenEditor.dll.mdb │ ├── DOTweenEditor.dll.mdb.meta │ ├── DOTweenEditor.dll.meta │ ├── Imgs.meta │ └── Imgs │ │ ├── DOTweenIcon.png │ │ ├── DOTweenIcon.png.meta │ │ ├── Footer.png │ │ ├── Footer.png.meta │ │ ├── Footer_dark.png │ │ ├── Footer_dark.png.meta │ │ ├── Header.jpg │ │ └── Header.jpg.meta │ ├── readme.txt │ └── readme.txt.meta ├── Images ├── Content.png ├── LoopVerticalScrollRect.png ├── ScrollCell.png ├── demo1.gif ├── demo2.gif └── demo3.gif ├── ProjectSettings ├── AudioManager.asset ├── ClusterInputManager.asset ├── DynamicsManager.asset ├── EditorBuildSettings.asset ├── EditorSettings.asset ├── GraphicsSettings.asset ├── InputManager.asset ├── NavMeshAreas.asset ├── NetworkManager.asset ├── Physics2DSettings.asset ├── ProjectSettings.asset ├── ProjectVersion.txt ├── QualitySettings.asset ├── TagManager.asset ├── TimeManager.asset ├── UnityAdsSettings.asset ├── UnityAnalyticsManager.asset └── UnityConnectSettings.asset └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | /[Ll]ibrary/ 2 | /[Tt]emp/ 3 | /[Oo]bj/ 4 | /[Bb]uild/ 5 | uframe-log.txt 6 | # Autogenerated VS/MD solution and project files 7 | *.csproj 8 | *.unityproj 9 | *.sln 10 | *.suo 11 | *.tmp 12 | *.user 13 | *.userprefs 14 | *.pidb 15 | *.booproj 16 | 17 | # Unity3D generated meta files 18 | *.pidb.meta 19 | 20 | # Unity3D Generated File On Crash Reports 21 | sysinfo.txt 22 | 23 | # OS generated 24 | .DS_Store 25 | .DS_Store? 26 | ._* 27 | .Spotlight-V100 28 | .Trashes 29 | ehthumbs.db 30 | Thumbs.db 31 | -------------------------------------------------------------------------------- /Assets/Demo.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d2175890aaf8a5a4ca0d06dbd5b30932 3 | folderAsset: yes 4 | timeCreated: 1439396419 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Demo/DemoScene.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bb16de1fffe5c164696efe7c5c3bb7d1 3 | timeCreated: 1439396359 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Demo/Resources.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bcd8464e40b5d9d40b2cb448cdcad0d5 3 | folderAsset: yes 4 | timeCreated: 1439425346 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Demo/Resources/ScrollCell1.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &108710 4 | GameObject: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 100100000} 8 | serializedVersion: 4 9 | m_Component: 10 | - 224: {fileID: 22435118} 11 | - 222: {fileID: 22270478} 12 | - 114: {fileID: 11410392} 13 | m_Layer: 5 14 | m_Name: Text 15 | m_TagString: Untagged 16 | m_Icon: {fileID: 0} 17 | m_NavMeshLayer: 0 18 | m_StaticEditorFlags: 0 19 | m_IsActive: 1 20 | --- !u!1 &183744 21 | GameObject: 22 | m_ObjectHideFlags: 0 23 | m_PrefabParentObject: {fileID: 0} 24 | m_PrefabInternal: {fileID: 100100000} 25 | serializedVersion: 4 26 | m_Component: 27 | - 224: {fileID: 22418634} 28 | - 222: {fileID: 22216460} 29 | - 114: {fileID: 11487888} 30 | - 114: {fileID: 11439716} 31 | - 114: {fileID: 11464570} 32 | - 114: {fileID: 11468506} 33 | m_Layer: 5 34 | m_Name: ScrollCell1 35 | m_TagString: Untagged 36 | m_Icon: {fileID: 0} 37 | m_NavMeshLayer: 0 38 | m_StaticEditorFlags: 0 39 | m_IsActive: 1 40 | --- !u!114 &11410392 41 | MonoBehaviour: 42 | m_ObjectHideFlags: 1 43 | m_PrefabParentObject: {fileID: 0} 44 | m_PrefabInternal: {fileID: 100100000} 45 | m_GameObject: {fileID: 108710} 46 | m_Enabled: 1 47 | m_EditorHideFlags: 0 48 | m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} 49 | m_Name: 50 | m_EditorClassIdentifier: 51 | m_Material: {fileID: 0} 52 | m_Color: {r: .196078435, g: .196078435, b: .196078435, a: 1} 53 | m_FontData: 54 | m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} 55 | m_FontSize: 14 56 | m_FontStyle: 0 57 | m_BestFit: 0 58 | m_MinSize: 10 59 | m_MaxSize: 40 60 | m_Alignment: 4 61 | m_RichText: 1 62 | m_HorizontalOverflow: 0 63 | m_VerticalOverflow: 0 64 | m_LineSpacing: 1 65 | m_Text: Button 66 | --- !u!114 &11439716 67 | MonoBehaviour: 68 | m_ObjectHideFlags: 1 69 | m_PrefabParentObject: {fileID: 0} 70 | m_PrefabInternal: {fileID: 100100000} 71 | m_GameObject: {fileID: 183744} 72 | m_Enabled: 1 73 | m_EditorHideFlags: 0 74 | m_Script: {fileID: 1392445389, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} 75 | m_Name: 76 | m_EditorClassIdentifier: 77 | m_Navigation: 78 | m_Mode: 3 79 | m_SelectOnUp: {fileID: 0} 80 | m_SelectOnDown: {fileID: 0} 81 | m_SelectOnLeft: {fileID: 0} 82 | m_SelectOnRight: {fileID: 0} 83 | m_Transition: 1 84 | m_Colors: 85 | m_NormalColor: {r: 1, g: 1, b: 1, a: 1} 86 | m_HighlightedColor: {r: .960784316, g: .960784316, b: .960784316, a: 1} 87 | m_PressedColor: {r: .784313738, g: .784313738, b: .784313738, a: 1} 88 | m_DisabledColor: {r: .784313738, g: .784313738, b: .784313738, a: .501960814} 89 | m_ColorMultiplier: 1 90 | m_FadeDuration: .100000001 91 | m_SpriteState: 92 | m_HighlightedSprite: {fileID: 0} 93 | m_PressedSprite: {fileID: 0} 94 | m_DisabledSprite: {fileID: 0} 95 | m_AnimationTriggers: 96 | m_NormalTrigger: Normal 97 | m_HighlightedTrigger: Highlighted 98 | m_PressedTrigger: Pressed 99 | m_DisabledTrigger: Disabled 100 | m_Interactable: 1 101 | m_TargetGraphic: {fileID: 11487888} 102 | m_OnClick: 103 | m_PersistentCalls: 104 | m_Calls: [] 105 | m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, 106 | Culture=neutral, PublicKeyToken=null 107 | --- !u!114 &11464570 108 | MonoBehaviour: 109 | m_ObjectHideFlags: 1 110 | m_PrefabParentObject: {fileID: 0} 111 | m_PrefabInternal: {fileID: 100100000} 112 | m_GameObject: {fileID: 183744} 113 | m_Enabled: 1 114 | m_EditorHideFlags: 0 115 | m_Script: {fileID: 1679637790, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} 116 | m_Name: 117 | m_EditorClassIdentifier: 118 | m_IgnoreLayout: 0 119 | m_MinWidth: -1 120 | m_MinHeight: -1 121 | m_PreferredWidth: 150 122 | m_PreferredHeight: 50 123 | m_FlexibleWidth: -1 124 | m_FlexibleHeight: -1 125 | --- !u!114 &11468506 126 | MonoBehaviour: 127 | m_ObjectHideFlags: 1 128 | m_PrefabParentObject: {fileID: 0} 129 | m_PrefabInternal: {fileID: 100100000} 130 | m_GameObject: {fileID: 183744} 131 | m_Enabled: 1 132 | m_EditorHideFlags: 0 133 | m_Script: {fileID: 11500000, guid: aae79c5fe0add56479237307a95fbb7f, type: 3} 134 | m_Name: 135 | m_EditorClassIdentifier: 136 | image: {fileID: 11487888} 137 | text: {fileID: 11410392} 138 | --- !u!114 &11487888 139 | MonoBehaviour: 140 | m_ObjectHideFlags: 1 141 | m_PrefabParentObject: {fileID: 0} 142 | m_PrefabInternal: {fileID: 100100000} 143 | m_GameObject: {fileID: 183744} 144 | m_Enabled: 1 145 | m_EditorHideFlags: 0 146 | m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} 147 | m_Name: 148 | m_EditorClassIdentifier: 149 | m_Material: {fileID: 0} 150 | m_Color: {r: 1, g: 1, b: 1, a: 1} 151 | m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} 152 | m_Type: 1 153 | m_PreserveAspect: 0 154 | m_FillCenter: 1 155 | m_FillMethod: 4 156 | m_FillAmount: 1 157 | m_FillClockwise: 1 158 | m_FillOrigin: 0 159 | --- !u!222 &22216460 160 | CanvasRenderer: 161 | m_ObjectHideFlags: 1 162 | m_PrefabParentObject: {fileID: 0} 163 | m_PrefabInternal: {fileID: 100100000} 164 | m_GameObject: {fileID: 183744} 165 | --- !u!222 &22270478 166 | CanvasRenderer: 167 | m_ObjectHideFlags: 1 168 | m_PrefabParentObject: {fileID: 0} 169 | m_PrefabInternal: {fileID: 100100000} 170 | m_GameObject: {fileID: 108710} 171 | --- !u!224 &22418634 172 | RectTransform: 173 | m_ObjectHideFlags: 1 174 | m_PrefabParentObject: {fileID: 0} 175 | m_PrefabInternal: {fileID: 100100000} 176 | m_GameObject: {fileID: 183744} 177 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 178 | m_LocalPosition: {x: 0, y: 0, z: 0} 179 | m_LocalScale: {x: 1, y: 1, z: 1} 180 | m_Children: 181 | - {fileID: 22435118} 182 | m_Father: {fileID: 0} 183 | m_RootOrder: 0 184 | m_AnchorMin: {x: 0, y: 0} 185 | m_AnchorMax: {x: 0, y: 0} 186 | m_AnchoredPosition: {x: 0, y: 0} 187 | m_SizeDelta: {x: 0, y: 0} 188 | m_Pivot: {x: .5, y: .5} 189 | --- !u!224 &22435118 190 | RectTransform: 191 | m_ObjectHideFlags: 1 192 | m_PrefabParentObject: {fileID: 0} 193 | m_PrefabInternal: {fileID: 100100000} 194 | m_GameObject: {fileID: 108710} 195 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 196 | m_LocalPosition: {x: 0, y: 0, z: 0} 197 | m_LocalScale: {x: 1, y: 1, z: 1} 198 | m_Children: [] 199 | m_Father: {fileID: 22418634} 200 | m_RootOrder: 0 201 | m_AnchorMin: {x: 0, y: 0} 202 | m_AnchorMax: {x: 1, y: 1} 203 | m_AnchoredPosition: {x: 0, y: 0} 204 | m_SizeDelta: {x: 0, y: 0} 205 | m_Pivot: {x: .5, y: .5} 206 | --- !u!1001 &100100000 207 | Prefab: 208 | m_ObjectHideFlags: 1 209 | serializedVersion: 2 210 | m_Modification: 211 | m_TransformParent: {fileID: 0} 212 | m_Modifications: 213 | - target: {fileID: 0} 214 | propertyPath: m_PreferredWidth 215 | value: 150 216 | objectReference: {fileID: 0} 217 | - target: {fileID: 0} 218 | propertyPath: m_PreferredHeight 219 | value: 50 220 | objectReference: {fileID: 0} 221 | - target: {fileID: 0} 222 | propertyPath: image 223 | value: 224 | objectReference: {fileID: 11487888} 225 | m_RemovedComponents: [] 226 | m_ParentPrefab: {fileID: 0} 227 | m_RootGameObject: {fileID: 183744} 228 | m_IsPrefabParent: 1 229 | -------------------------------------------------------------------------------- /Assets/Demo/Resources/ScrollCell1.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 22b5f8ed284b7904299d6ca6a21597ad 3 | timeCreated: 1439425233 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Demo/Resources/ScrollCell2.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &108666 4 | GameObject: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 100100000} 8 | serializedVersion: 4 9 | m_Component: 10 | - 224: {fileID: 22478042} 11 | - 222: {fileID: 22298252} 12 | - 114: {fileID: 11410352} 13 | m_Layer: 5 14 | m_Name: Text 15 | m_TagString: Untagged 16 | m_Icon: {fileID: 0} 17 | m_NavMeshLayer: 0 18 | m_StaticEditorFlags: 0 19 | m_IsActive: 1 20 | --- !u!1 &137000 21 | GameObject: 22 | m_ObjectHideFlags: 0 23 | m_PrefabParentObject: {fileID: 0} 24 | m_PrefabInternal: {fileID: 100100000} 25 | serializedVersion: 4 26 | m_Component: 27 | - 224: {fileID: 22424898} 28 | - 222: {fileID: 22244204} 29 | - 114: {fileID: 11476074} 30 | - 114: {fileID: 11496432} 31 | - 114: {fileID: 11418372} 32 | - 114: {fileID: 11477872} 33 | m_Layer: 5 34 | m_Name: ScrollCell2 35 | m_TagString: Untagged 36 | m_Icon: {fileID: 0} 37 | m_NavMeshLayer: 0 38 | m_StaticEditorFlags: 0 39 | m_IsActive: 1 40 | --- !u!114 &11410352 41 | MonoBehaviour: 42 | m_ObjectHideFlags: 1 43 | m_PrefabParentObject: {fileID: 0} 44 | m_PrefabInternal: {fileID: 100100000} 45 | m_GameObject: {fileID: 108666} 46 | m_Enabled: 1 47 | m_EditorHideFlags: 0 48 | m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} 49 | m_Name: 50 | m_EditorClassIdentifier: 51 | m_Material: {fileID: 0} 52 | m_Color: {r: .196078435, g: .196078435, b: .196078435, a: 1} 53 | m_FontData: 54 | m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} 55 | m_FontSize: 14 56 | m_FontStyle: 0 57 | m_BestFit: 0 58 | m_MinSize: 10 59 | m_MaxSize: 40 60 | m_Alignment: 4 61 | m_RichText: 1 62 | m_HorizontalOverflow: 0 63 | m_VerticalOverflow: 0 64 | m_LineSpacing: 1 65 | m_Text: Button 66 | --- !u!114 &11418372 67 | MonoBehaviour: 68 | m_ObjectHideFlags: 1 69 | m_PrefabParentObject: {fileID: 0} 70 | m_PrefabInternal: {fileID: 100100000} 71 | m_GameObject: {fileID: 137000} 72 | m_Enabled: 1 73 | m_EditorHideFlags: 0 74 | m_Script: {fileID: 1679637790, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} 75 | m_Name: 76 | m_EditorClassIdentifier: 77 | m_IgnoreLayout: 0 78 | m_MinWidth: -1 79 | m_MinHeight: -1 80 | m_PreferredWidth: 100 81 | m_PreferredHeight: 150 82 | m_FlexibleWidth: -1 83 | m_FlexibleHeight: -1 84 | --- !u!114 &11476074 85 | MonoBehaviour: 86 | m_ObjectHideFlags: 1 87 | m_PrefabParentObject: {fileID: 0} 88 | m_PrefabInternal: {fileID: 100100000} 89 | m_GameObject: {fileID: 137000} 90 | m_Enabled: 1 91 | m_EditorHideFlags: 0 92 | m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} 93 | m_Name: 94 | m_EditorClassIdentifier: 95 | m_Material: {fileID: 0} 96 | m_Color: {r: 1, g: 1, b: 1, a: 1} 97 | m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} 98 | m_Type: 1 99 | m_PreserveAspect: 0 100 | m_FillCenter: 1 101 | m_FillMethod: 4 102 | m_FillAmount: 1 103 | m_FillClockwise: 1 104 | m_FillOrigin: 0 105 | --- !u!114 &11477872 106 | MonoBehaviour: 107 | m_ObjectHideFlags: 1 108 | m_PrefabParentObject: {fileID: 0} 109 | m_PrefabInternal: {fileID: 100100000} 110 | m_GameObject: {fileID: 137000} 111 | m_Enabled: 1 112 | m_EditorHideFlags: 0 113 | m_Script: {fileID: 11500000, guid: 4d2a1b5a8e8308e4fbd894c93c0caa09, type: 3} 114 | m_Name: 115 | m_EditorClassIdentifier: 116 | text: {fileID: 11410352} 117 | element: {fileID: 11418372} 118 | --- !u!114 &11496432 119 | MonoBehaviour: 120 | m_ObjectHideFlags: 1 121 | m_PrefabParentObject: {fileID: 0} 122 | m_PrefabInternal: {fileID: 100100000} 123 | m_GameObject: {fileID: 137000} 124 | m_Enabled: 1 125 | m_EditorHideFlags: 0 126 | m_Script: {fileID: 1392445389, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} 127 | m_Name: 128 | m_EditorClassIdentifier: 129 | m_Navigation: 130 | m_Mode: 3 131 | m_SelectOnUp: {fileID: 0} 132 | m_SelectOnDown: {fileID: 0} 133 | m_SelectOnLeft: {fileID: 0} 134 | m_SelectOnRight: {fileID: 0} 135 | m_Transition: 1 136 | m_Colors: 137 | m_NormalColor: {r: 1, g: 1, b: 1, a: 1} 138 | m_HighlightedColor: {r: .960784316, g: .960784316, b: .960784316, a: 1} 139 | m_PressedColor: {r: .784313738, g: .784313738, b: .784313738, a: 1} 140 | m_DisabledColor: {r: .784313738, g: .784313738, b: .784313738, a: .501960814} 141 | m_ColorMultiplier: 1 142 | m_FadeDuration: .100000001 143 | m_SpriteState: 144 | m_HighlightedSprite: {fileID: 0} 145 | m_PressedSprite: {fileID: 0} 146 | m_DisabledSprite: {fileID: 0} 147 | m_AnimationTriggers: 148 | m_NormalTrigger: Normal 149 | m_HighlightedTrigger: Highlighted 150 | m_PressedTrigger: Pressed 151 | m_DisabledTrigger: Disabled 152 | m_Interactable: 1 153 | m_TargetGraphic: {fileID: 11476074} 154 | m_OnClick: 155 | m_PersistentCalls: 156 | m_Calls: [] 157 | m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, 158 | Culture=neutral, PublicKeyToken=null 159 | --- !u!222 &22244204 160 | CanvasRenderer: 161 | m_ObjectHideFlags: 1 162 | m_PrefabParentObject: {fileID: 0} 163 | m_PrefabInternal: {fileID: 100100000} 164 | m_GameObject: {fileID: 137000} 165 | --- !u!222 &22298252 166 | CanvasRenderer: 167 | m_ObjectHideFlags: 1 168 | m_PrefabParentObject: {fileID: 0} 169 | m_PrefabInternal: {fileID: 100100000} 170 | m_GameObject: {fileID: 108666} 171 | --- !u!224 &22424898 172 | RectTransform: 173 | m_ObjectHideFlags: 1 174 | m_PrefabParentObject: {fileID: 0} 175 | m_PrefabInternal: {fileID: 100100000} 176 | m_GameObject: {fileID: 137000} 177 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 178 | m_LocalPosition: {x: 0, y: 0, z: 0} 179 | m_LocalScale: {x: 1, y: 1, z: 1} 180 | m_Children: 181 | - {fileID: 22478042} 182 | m_Father: {fileID: 0} 183 | m_RootOrder: 0 184 | m_AnchorMin: {x: 0, y: 0} 185 | m_AnchorMax: {x: 0, y: 0} 186 | m_AnchoredPosition: {x: 0, y: 0} 187 | m_SizeDelta: {x: 0, y: 0} 188 | m_Pivot: {x: .5, y: .5} 189 | --- !u!224 &22478042 190 | RectTransform: 191 | m_ObjectHideFlags: 1 192 | m_PrefabParentObject: {fileID: 0} 193 | m_PrefabInternal: {fileID: 100100000} 194 | m_GameObject: {fileID: 108666} 195 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 196 | m_LocalPosition: {x: 0, y: 0, z: 0} 197 | m_LocalScale: {x: 1, y: 1, z: 1} 198 | m_Children: [] 199 | m_Father: {fileID: 22424898} 200 | m_RootOrder: 0 201 | m_AnchorMin: {x: 0, y: 0} 202 | m_AnchorMax: {x: 1, y: 1} 203 | m_AnchoredPosition: {x: 0, y: 0} 204 | m_SizeDelta: {x: 0, y: 0} 205 | m_Pivot: {x: .5, y: .5} 206 | --- !u!1001 &100100000 207 | Prefab: 208 | m_ObjectHideFlags: 1 209 | serializedVersion: 2 210 | m_Modification: 211 | m_TransformParent: {fileID: 0} 212 | m_Modifications: [] 213 | m_RemovedComponents: [] 214 | m_ParentPrefab: {fileID: 0} 215 | m_RootGameObject: {fileID: 137000} 216 | m_IsPrefabParent: 1 217 | -------------------------------------------------------------------------------- /Assets/Demo/Resources/ScrollCell2.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 58f2a669cd6976d4ca4c72cd7bfa298c 3 | timeCreated: 1439607751 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Demo/Resources/ScrollCell3.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &125280 4 | GameObject: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 100100000} 8 | serializedVersion: 4 9 | m_Component: 10 | - 224: {fileID: 22436942} 11 | - 222: {fileID: 22215342} 12 | - 114: {fileID: 11469264} 13 | m_Layer: 5 14 | m_Name: Text 15 | m_TagString: Untagged 16 | m_Icon: {fileID: 0} 17 | m_NavMeshLayer: 0 18 | m_StaticEditorFlags: 0 19 | m_IsActive: 1 20 | --- !u!1 &174784 21 | GameObject: 22 | m_ObjectHideFlags: 0 23 | m_PrefabParentObject: {fileID: 0} 24 | m_PrefabInternal: {fileID: 100100000} 25 | serializedVersion: 4 26 | m_Component: 27 | - 224: {fileID: 22411180} 28 | - 222: {fileID: 22240748} 29 | - 114: {fileID: 11429772} 30 | - 114: {fileID: 11402414} 31 | - 114: {fileID: 11425032} 32 | - 114: {fileID: 11478532} 33 | m_Layer: 5 34 | m_Name: ScrollCell3 35 | m_TagString: Untagged 36 | m_Icon: {fileID: 0} 37 | m_NavMeshLayer: 0 38 | m_StaticEditorFlags: 0 39 | m_IsActive: 1 40 | --- !u!114 &11402414 41 | MonoBehaviour: 42 | m_ObjectHideFlags: 1 43 | m_PrefabParentObject: {fileID: 0} 44 | m_PrefabInternal: {fileID: 100100000} 45 | m_GameObject: {fileID: 174784} 46 | m_Enabled: 1 47 | m_EditorHideFlags: 0 48 | m_Script: {fileID: 1392445389, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} 49 | m_Name: 50 | m_EditorClassIdentifier: 51 | m_Navigation: 52 | m_Mode: 3 53 | m_SelectOnUp: {fileID: 0} 54 | m_SelectOnDown: {fileID: 0} 55 | m_SelectOnLeft: {fileID: 0} 56 | m_SelectOnRight: {fileID: 0} 57 | m_Transition: 1 58 | m_Colors: 59 | m_NormalColor: {r: 1, g: 1, b: 1, a: 1} 60 | m_HighlightedColor: {r: .960784316, g: .960784316, b: .960784316, a: 1} 61 | m_PressedColor: {r: .784313738, g: .784313738, b: .784313738, a: 1} 62 | m_DisabledColor: {r: .784313738, g: .784313738, b: .784313738, a: .501960814} 63 | m_ColorMultiplier: 1 64 | m_FadeDuration: .100000001 65 | m_SpriteState: 66 | m_HighlightedSprite: {fileID: 0} 67 | m_PressedSprite: {fileID: 0} 68 | m_DisabledSprite: {fileID: 0} 69 | m_AnimationTriggers: 70 | m_NormalTrigger: Normal 71 | m_HighlightedTrigger: Highlighted 72 | m_PressedTrigger: Pressed 73 | m_DisabledTrigger: Disabled 74 | m_Interactable: 1 75 | m_TargetGraphic: {fileID: 11429772} 76 | m_OnClick: 77 | m_PersistentCalls: 78 | m_Calls: [] 79 | m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, 80 | Culture=neutral, PublicKeyToken=null 81 | --- !u!114 &11425032 82 | MonoBehaviour: 83 | m_ObjectHideFlags: 1 84 | m_PrefabParentObject: {fileID: 0} 85 | m_PrefabInternal: {fileID: 100100000} 86 | m_GameObject: {fileID: 174784} 87 | m_Enabled: 1 88 | m_EditorHideFlags: 0 89 | m_Script: {fileID: 11500000, guid: 485315e3fd2b43d4d8d15c437f7f01d3, type: 3} 90 | m_Name: 91 | m_EditorClassIdentifier: 92 | text: {fileID: 11469264} 93 | --- !u!114 &11429772 94 | MonoBehaviour: 95 | m_ObjectHideFlags: 1 96 | m_PrefabParentObject: {fileID: 0} 97 | m_PrefabInternal: {fileID: 100100000} 98 | m_GameObject: {fileID: 174784} 99 | m_Enabled: 1 100 | m_EditorHideFlags: 0 101 | m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} 102 | m_Name: 103 | m_EditorClassIdentifier: 104 | m_Material: {fileID: 0} 105 | m_Color: {r: 1, g: 1, b: 1, a: 1} 106 | m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} 107 | m_Type: 1 108 | m_PreserveAspect: 0 109 | m_FillCenter: 1 110 | m_FillMethod: 4 111 | m_FillAmount: 1 112 | m_FillClockwise: 1 113 | m_FillOrigin: 0 114 | --- !u!114 &11469264 115 | MonoBehaviour: 116 | m_ObjectHideFlags: 1 117 | m_PrefabParentObject: {fileID: 0} 118 | m_PrefabInternal: {fileID: 100100000} 119 | m_GameObject: {fileID: 125280} 120 | m_Enabled: 1 121 | m_EditorHideFlags: 0 122 | m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} 123 | m_Name: 124 | m_EditorClassIdentifier: 125 | m_Material: {fileID: 0} 126 | m_Color: {r: .196078435, g: .196078435, b: .196078435, a: 1} 127 | m_FontData: 128 | m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} 129 | m_FontSize: 14 130 | m_FontStyle: 0 131 | m_BestFit: 0 132 | m_MinSize: 10 133 | m_MaxSize: 40 134 | m_Alignment: 4 135 | m_RichText: 1 136 | m_HorizontalOverflow: 0 137 | m_VerticalOverflow: 0 138 | m_LineSpacing: 1 139 | m_Text: Button 140 | --- !u!114 &11478532 141 | MonoBehaviour: 142 | m_ObjectHideFlags: 1 143 | m_PrefabParentObject: {fileID: 0} 144 | m_PrefabInternal: {fileID: 100100000} 145 | m_GameObject: {fileID: 174784} 146 | m_Enabled: 1 147 | m_EditorHideFlags: 0 148 | m_Script: {fileID: 1679637790, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} 149 | m_Name: 150 | m_EditorClassIdentifier: 151 | m_IgnoreLayout: 0 152 | m_MinWidth: -1 153 | m_MinHeight: -1 154 | m_PreferredWidth: 100 155 | m_PreferredHeight: 100 156 | m_FlexibleWidth: -1 157 | m_FlexibleHeight: -1 158 | --- !u!222 &22215342 159 | CanvasRenderer: 160 | m_ObjectHideFlags: 1 161 | m_PrefabParentObject: {fileID: 0} 162 | m_PrefabInternal: {fileID: 100100000} 163 | m_GameObject: {fileID: 125280} 164 | --- !u!222 &22240748 165 | CanvasRenderer: 166 | m_ObjectHideFlags: 1 167 | m_PrefabParentObject: {fileID: 0} 168 | m_PrefabInternal: {fileID: 100100000} 169 | m_GameObject: {fileID: 174784} 170 | --- !u!224 &22411180 171 | RectTransform: 172 | m_ObjectHideFlags: 1 173 | m_PrefabParentObject: {fileID: 0} 174 | m_PrefabInternal: {fileID: 100100000} 175 | m_GameObject: {fileID: 174784} 176 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 177 | m_LocalPosition: {x: 0, y: 0, z: 0} 178 | m_LocalScale: {x: 1, y: 1, z: 1} 179 | m_Children: 180 | - {fileID: 22436942} 181 | m_Father: {fileID: 0} 182 | m_RootOrder: 0 183 | m_AnchorMin: {x: 0, y: 0} 184 | m_AnchorMax: {x: 0, y: 0} 185 | m_AnchoredPosition: {x: 0, y: 0} 186 | m_SizeDelta: {x: 0, y: 0} 187 | m_Pivot: {x: .5, y: .5} 188 | --- !u!224 &22436942 189 | RectTransform: 190 | m_ObjectHideFlags: 1 191 | m_PrefabParentObject: {fileID: 0} 192 | m_PrefabInternal: {fileID: 100100000} 193 | m_GameObject: {fileID: 125280} 194 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 195 | m_LocalPosition: {x: 0, y: 0, z: 0} 196 | m_LocalScale: {x: 1, y: 1, z: 1} 197 | m_Children: [] 198 | m_Father: {fileID: 22411180} 199 | m_RootOrder: 0 200 | m_AnchorMin: {x: 0, y: 0} 201 | m_AnchorMax: {x: 1, y: 1} 202 | m_AnchoredPosition: {x: 0, y: 0} 203 | m_SizeDelta: {x: 0, y: 0} 204 | m_Pivot: {x: .5, y: .5} 205 | --- !u!1001 &100100000 206 | Prefab: 207 | m_ObjectHideFlags: 1 208 | serializedVersion: 2 209 | m_Modification: 210 | m_TransformParent: {fileID: 0} 211 | m_Modifications: 212 | - target: {fileID: 0} 213 | propertyPath: m_PreferredWidth 214 | value: 0 215 | objectReference: {fileID: 0} 216 | m_RemovedComponents: [] 217 | m_ParentPrefab: {fileID: 0} 218 | m_RootGameObject: {fileID: 174784} 219 | m_IsPrefabParent: 1 220 | -------------------------------------------------------------------------------- /Assets/Demo/Resources/ScrollCell3.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 56b618cf8c6e1584db503ad2cee1f27f 3 | timeCreated: 1439608466 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Demo/RoleCardsShow.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 327f17386037f174e84533aadc102efc 3 | timeCreated: 1493101867 4 | licenseType: Pro 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Demo/ScaleScrollRect.unity: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!29 &1 4 | OcclusionCullingSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_OcclusionBakeSettings: 8 | smallestOccluder: 5 9 | smallestHole: 0.25 10 | backfaceThreshold: 100 11 | m_SceneGUID: 00000000000000000000000000000000 12 | m_OcclusionCullingData: {fileID: 0} 13 | --- !u!104 &2 14 | RenderSettings: 15 | m_ObjectHideFlags: 0 16 | serializedVersion: 7 17 | m_Fog: 0 18 | m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} 19 | m_FogMode: 3 20 | m_FogDensity: 0.01 21 | m_LinearFogStart: 0 22 | m_LinearFogEnd: 300 23 | m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} 24 | m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} 25 | m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} 26 | m_AmbientIntensity: 1 27 | m_AmbientMode: 0 28 | m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} 29 | m_HaloStrength: 0.5 30 | m_FlareStrength: 1 31 | m_FlareFadeSpeed: 3 32 | m_HaloTexture: {fileID: 0} 33 | m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} 34 | m_DefaultReflectionMode: 0 35 | m_DefaultReflectionResolution: 128 36 | m_ReflectionBounces: 1 37 | m_ReflectionIntensity: 1 38 | m_CustomReflection: {fileID: 0} 39 | m_Sun: {fileID: 0} 40 | m_IndirectSpecularColor: {r: 0.37311992, g: 0.38074034, b: 0.35872713, a: 1} 41 | --- !u!157 &3 42 | LightmapSettings: 43 | m_ObjectHideFlags: 0 44 | serializedVersion: 7 45 | m_GIWorkflowMode: 0 46 | m_GISettings: 47 | serializedVersion: 2 48 | m_BounceScale: 1 49 | m_IndirectOutputScale: 1 50 | m_AlbedoBoost: 1 51 | m_TemporalCoherenceThreshold: 1 52 | m_EnvironmentLightingMode: 0 53 | m_EnableBakedLightmaps: 1 54 | m_EnableRealtimeLightmaps: 1 55 | m_LightmapEditorSettings: 56 | serializedVersion: 4 57 | m_Resolution: 2 58 | m_BakeResolution: 40 59 | m_TextureWidth: 1024 60 | m_TextureHeight: 1024 61 | m_AO: 0 62 | m_AOMaxDistance: 1 63 | m_CompAOExponent: 1 64 | m_CompAOExponentDirect: 0 65 | m_Padding: 2 66 | m_LightmapParameters: {fileID: 0} 67 | m_LightmapsBakeMode: 1 68 | m_TextureCompression: 1 69 | m_DirectLightInLightProbes: 1 70 | m_FinalGather: 0 71 | m_FinalGatherFiltering: 1 72 | m_FinalGatherRayCount: 256 73 | m_ReflectionCompression: 2 74 | m_LightingDataAsset: {fileID: 0} 75 | m_RuntimeCPUUsage: 25 76 | --- !u!196 &4 77 | NavMeshSettings: 78 | serializedVersion: 2 79 | m_ObjectHideFlags: 0 80 | m_BuildSettings: 81 | serializedVersion: 2 82 | agentTypeID: 0 83 | agentRadius: 0.5 84 | agentHeight: 2 85 | agentSlope: 45 86 | agentClimb: 0.4 87 | ledgeDropHeight: 0 88 | maxJumpAcrossDistance: 0 89 | minRegionArea: 2 90 | manualCellSize: 0 91 | cellSize: 0.16666667 92 | accuratePlacement: 0 93 | m_NavMeshData: {fileID: 0} 94 | --- !u!1 &74624843 95 | GameObject: 96 | m_ObjectHideFlags: 0 97 | m_PrefabParentObject: {fileID: 0} 98 | m_PrefabInternal: {fileID: 0} 99 | serializedVersion: 5 100 | m_Component: 101 | - component: {fileID: 74624848} 102 | - component: {fileID: 74624847} 103 | - component: {fileID: 74624846} 104 | - component: {fileID: 74624845} 105 | - component: {fileID: 74624844} 106 | m_Layer: 0 107 | m_Name: Main Camera 108 | m_TagString: MainCamera 109 | m_Icon: {fileID: 0} 110 | m_NavMeshLayer: 0 111 | m_StaticEditorFlags: 0 112 | m_IsActive: 1 113 | --- !u!81 &74624844 114 | AudioListener: 115 | m_ObjectHideFlags: 0 116 | m_PrefabParentObject: {fileID: 0} 117 | m_PrefabInternal: {fileID: 0} 118 | m_GameObject: {fileID: 74624843} 119 | m_Enabled: 1 120 | --- !u!124 &74624845 121 | Behaviour: 122 | m_ObjectHideFlags: 0 123 | m_PrefabParentObject: {fileID: 0} 124 | m_PrefabInternal: {fileID: 0} 125 | m_GameObject: {fileID: 74624843} 126 | m_Enabled: 1 127 | --- !u!92 &74624846 128 | Behaviour: 129 | m_ObjectHideFlags: 0 130 | m_PrefabParentObject: {fileID: 0} 131 | m_PrefabInternal: {fileID: 0} 132 | m_GameObject: {fileID: 74624843} 133 | m_Enabled: 1 134 | --- !u!20 &74624847 135 | Camera: 136 | m_ObjectHideFlags: 0 137 | m_PrefabParentObject: {fileID: 0} 138 | m_PrefabInternal: {fileID: 0} 139 | m_GameObject: {fileID: 74624843} 140 | m_Enabled: 1 141 | serializedVersion: 2 142 | m_ClearFlags: 1 143 | m_BackGroundColor: {r: 0.20209776, g: 0.37799764, b: 0.6544118, a: 0} 144 | m_NormalizedViewPortRect: 145 | serializedVersion: 2 146 | x: 0 147 | y: 0 148 | width: 1 149 | height: 1 150 | near clip plane: 0.3 151 | far clip plane: 1000 152 | field of view: 60 153 | orthographic: 1 154 | orthographic size: 5 155 | m_Depth: 5 156 | m_CullingMask: 157 | serializedVersion: 2 158 | m_Bits: 4294967295 159 | m_RenderingPath: -1 160 | m_TargetTexture: {fileID: 0} 161 | m_TargetDisplay: 0 162 | m_TargetEye: 3 163 | m_HDR: 0 164 | m_OcclusionCulling: 1 165 | m_StereoConvergence: 10 166 | m_StereoSeparation: 0.022 167 | m_StereoMirrorMode: 0 168 | --- !u!4 &74624848 169 | Transform: 170 | m_ObjectHideFlags: 0 171 | m_PrefabParentObject: {fileID: 0} 172 | m_PrefabInternal: {fileID: 0} 173 | m_GameObject: {fileID: 74624843} 174 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 175 | m_LocalPosition: {x: 0, y: 1, z: -10} 176 | m_LocalScale: {x: 1, y: 1, z: 1} 177 | m_Children: [] 178 | m_Father: {fileID: 0} 179 | m_RootOrder: 0 180 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 181 | --- !u!1 &206688714 182 | GameObject: 183 | m_ObjectHideFlags: 0 184 | m_PrefabParentObject: {fileID: 0} 185 | m_PrefabInternal: {fileID: 0} 186 | serializedVersion: 5 187 | m_Component: 188 | - component: {fileID: 206688718} 189 | - component: {fileID: 206688717} 190 | - component: {fileID: 206688716} 191 | - component: {fileID: 206688715} 192 | m_Layer: 0 193 | m_Name: EventSystem 194 | m_TagString: Untagged 195 | m_Icon: {fileID: 0} 196 | m_NavMeshLayer: 0 197 | m_StaticEditorFlags: 0 198 | m_IsActive: 1 199 | --- !u!114 &206688715 200 | MonoBehaviour: 201 | m_ObjectHideFlags: 0 202 | m_PrefabParentObject: {fileID: 0} 203 | m_PrefabInternal: {fileID: 0} 204 | m_GameObject: {fileID: 206688714} 205 | m_Enabled: 1 206 | m_EditorHideFlags: 0 207 | m_Script: {fileID: 1997211142, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} 208 | m_Name: 209 | m_EditorClassIdentifier: 210 | m_ForceModuleActive: 0 211 | --- !u!114 &206688716 212 | MonoBehaviour: 213 | m_ObjectHideFlags: 0 214 | m_PrefabParentObject: {fileID: 0} 215 | m_PrefabInternal: {fileID: 0} 216 | m_GameObject: {fileID: 206688714} 217 | m_Enabled: 1 218 | m_EditorHideFlags: 0 219 | m_Script: {fileID: 1077351063, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} 220 | m_Name: 221 | m_EditorClassIdentifier: 222 | m_HorizontalAxis: Horizontal 223 | m_VerticalAxis: Vertical 224 | m_SubmitButton: Submit 225 | m_CancelButton: Cancel 226 | m_InputActionsPerSecond: 10 227 | m_RepeatDelay: 0.5 228 | m_ForceModuleActive: 0 229 | --- !u!114 &206688717 230 | MonoBehaviour: 231 | m_ObjectHideFlags: 0 232 | m_PrefabParentObject: {fileID: 0} 233 | m_PrefabInternal: {fileID: 0} 234 | m_GameObject: {fileID: 206688714} 235 | m_Enabled: 1 236 | m_EditorHideFlags: 0 237 | m_Script: {fileID: -619905303, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} 238 | m_Name: 239 | m_EditorClassIdentifier: 240 | m_FirstSelected: {fileID: 0} 241 | m_sendNavigationEvents: 1 242 | m_DragThreshold: 5 243 | --- !u!4 &206688718 244 | Transform: 245 | m_ObjectHideFlags: 0 246 | m_PrefabParentObject: {fileID: 0} 247 | m_PrefabInternal: {fileID: 0} 248 | m_GameObject: {fileID: 206688714} 249 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 250 | m_LocalPosition: {x: 2.5339806, y: 0.58693385, z: 90} 251 | m_LocalScale: {x: 1, y: 1, z: 1} 252 | m_Children: [] 253 | m_Father: {fileID: 0} 254 | m_RootOrder: 2 255 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 256 | --- !u!1 &639634517 257 | GameObject: 258 | m_ObjectHideFlags: 0 259 | m_PrefabParentObject: {fileID: 1059447638697964, guid: 6906f12c4a01bc648a169c54d68c60bf, 260 | type: 2} 261 | m_PrefabInternal: {fileID: 0} 262 | serializedVersion: 5 263 | m_Component: 264 | - component: {fileID: 639634521} 265 | - component: {fileID: 639634520} 266 | - component: {fileID: 639634519} 267 | - component: {fileID: 639634518} 268 | - component: {fileID: 639634522} 269 | m_Layer: 5 270 | m_Name: Canvas 271 | m_TagString: Untagged 272 | m_Icon: {fileID: 0} 273 | m_NavMeshLayer: 0 274 | m_StaticEditorFlags: 0 275 | m_IsActive: 1 276 | --- !u!114 &639634518 277 | MonoBehaviour: 278 | m_ObjectHideFlags: 0 279 | m_PrefabParentObject: {fileID: 114061668164667424, guid: 6906f12c4a01bc648a169c54d68c60bf, 280 | type: 2} 281 | m_PrefabInternal: {fileID: 0} 282 | m_GameObject: {fileID: 639634517} 283 | m_Enabled: 1 284 | m_EditorHideFlags: 0 285 | m_Script: {fileID: 1301386320, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} 286 | m_Name: 287 | m_EditorClassIdentifier: 288 | m_IgnoreReversedGraphics: 1 289 | m_BlockingObjects: 0 290 | m_BlockingMask: 291 | serializedVersion: 2 292 | m_Bits: 4294967295 293 | --- !u!114 &639634519 294 | MonoBehaviour: 295 | m_ObjectHideFlags: 0 296 | m_PrefabParentObject: {fileID: 114007989351461434, guid: 6906f12c4a01bc648a169c54d68c60bf, 297 | type: 2} 298 | m_PrefabInternal: {fileID: 0} 299 | m_GameObject: {fileID: 639634517} 300 | m_Enabled: 1 301 | m_EditorHideFlags: 0 302 | m_Script: {fileID: 1980459831, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} 303 | m_Name: 304 | m_EditorClassIdentifier: 305 | m_UiScaleMode: 1 306 | m_ReferencePixelsPerUnit: 100 307 | m_ScaleFactor: 1 308 | m_ReferenceResolution: {x: 1334, y: 750} 309 | m_ScreenMatchMode: 0 310 | m_MatchWidthOrHeight: 0 311 | m_PhysicalUnit: 3 312 | m_FallbackScreenDPI: 96 313 | m_DefaultSpriteDPI: 96 314 | m_DynamicPixelsPerUnit: 1 315 | --- !u!223 &639634520 316 | Canvas: 317 | m_ObjectHideFlags: 0 318 | m_PrefabParentObject: {fileID: 223423010422582336, guid: 6906f12c4a01bc648a169c54d68c60bf, 319 | type: 2} 320 | m_PrefabInternal: {fileID: 0} 321 | m_GameObject: {fileID: 639634517} 322 | m_Enabled: 1 323 | serializedVersion: 2 324 | m_RenderMode: 1 325 | m_Camera: {fileID: 74624847} 326 | m_PlaneDistance: 100 327 | m_PixelPerfect: 0 328 | m_ReceivesEvents: 1 329 | m_OverrideSorting: 0 330 | m_OverridePixelPerfect: 0 331 | m_SortingBucketNormalizedSize: 0 332 | m_SortingLayerID: 0 333 | m_SortingOrder: 0 334 | m_TargetDisplay: 0 335 | --- !u!224 &639634521 336 | RectTransform: 337 | m_ObjectHideFlags: 0 338 | m_PrefabParentObject: {fileID: 224177872826593350, guid: 6906f12c4a01bc648a169c54d68c60bf, 339 | type: 2} 340 | m_PrefabInternal: {fileID: 0} 341 | m_GameObject: {fileID: 639634517} 342 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 343 | m_LocalPosition: {x: 0, y: 0, z: 0} 344 | m_LocalScale: {x: 0, y: 0, z: 0} 345 | m_Children: 346 | - {fileID: 709536659} 347 | m_Father: {fileID: 0} 348 | m_RootOrder: 1 349 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 350 | m_AnchorMin: {x: 0, y: 0} 351 | m_AnchorMax: {x: 0, y: 0} 352 | m_AnchoredPosition: {x: 0, y: 0} 353 | m_SizeDelta: {x: 0, y: 0} 354 | m_Pivot: {x: 0, y: 0} 355 | --- !u!114 &639634522 356 | MonoBehaviour: 357 | m_ObjectHideFlags: 0 358 | m_PrefabParentObject: {fileID: 0} 359 | m_PrefabInternal: {fileID: 0} 360 | m_GameObject: {fileID: 639634517} 361 | m_Enabled: 1 362 | m_EditorHideFlags: 0 363 | m_Script: {fileID: 11500000, guid: c7b090740d014424590c0d1c975c09b6, type: 3} 364 | m_Name: 365 | m_EditorClassIdentifier: 366 | m_ScrollView: {fileID: 709536659} 367 | --- !u!1 &709536658 368 | GameObject: 369 | m_ObjectHideFlags: 0 370 | m_PrefabParentObject: {fileID: 0} 371 | m_PrefabInternal: {fileID: 0} 372 | serializedVersion: 5 373 | m_Component: 374 | - component: {fileID: 709536659} 375 | - component: {fileID: 709536660} 376 | m_Layer: 0 377 | m_Name: ScrollView 378 | m_TagString: Untagged 379 | m_Icon: {fileID: 0} 380 | m_NavMeshLayer: 0 381 | m_StaticEditorFlags: 0 382 | m_IsActive: 1 383 | --- !u!4 &709536659 384 | Transform: 385 | m_ObjectHideFlags: 0 386 | m_PrefabParentObject: {fileID: 0} 387 | m_PrefabInternal: {fileID: 0} 388 | m_GameObject: {fileID: 709536658} 389 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 390 | m_LocalPosition: {x: 0, y: 0, z: 0} 391 | m_LocalScale: {x: 1, y: 1, z: 1} 392 | m_Children: [] 393 | m_Father: {fileID: 639634521} 394 | m_RootOrder: 0 395 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 396 | --- !u!114 &709536660 397 | MonoBehaviour: 398 | m_ObjectHideFlags: 0 399 | m_PrefabParentObject: {fileID: 0} 400 | m_PrefabInternal: {fileID: 0} 401 | m_GameObject: {fileID: 709536658} 402 | m_Enabled: 0 403 | m_EditorHideFlags: 0 404 | m_Script: {fileID: 11500000, guid: 5377432c7ab4bec4d8bb961ba5c2a06f, type: 3} 405 | m_Name: 406 | m_EditorClassIdentifier: 407 | scaleCurve: 408 | serializedVersion: 2 409 | m_Curve: 410 | - serializedVersion: 2 411 | time: 0 412 | value: 0 413 | inSlope: 1.9798373 414 | outSlope: 1.9798373 415 | tangentMode: 34 416 | - serializedVersion: 2 417 | time: 0.4996251 418 | value: 0.9891764 419 | inSlope: -0.0017332435 420 | outSlope: -0.0017332435 421 | tangentMode: 34 422 | - serializedVersion: 2 423 | time: 0.99785787 424 | value: 0.0010294102 425 | inSlope: -1.9833038 426 | outSlope: -1.9833038 427 | tangentMode: 34 428 | m_PreInfinity: 1 429 | m_PostInfinity: 1 430 | m_RotationOrder: 0 431 | positionCurve: 432 | serializedVersion: 2 433 | m_Curve: 434 | - serializedVersion: 2 435 | time: 0 436 | value: 0.003731343 437 | inSlope: 0 438 | outSlope: 0 439 | tangentMode: 0 440 | - serializedVersion: 2 441 | time: 1 442 | value: 1.0037314 443 | inSlope: 0 444 | outSlope: 0 445 | tangentMode: 0 446 | m_PreInfinity: 1 447 | m_PostInfinity: 1 448 | m_RotationOrder: 0 449 | posCurveFactor: 500 450 | yPositionValue: 46 451 | scrollViewItems: [] 452 | dFactor: 0.2 453 | horizontalValue: 0 454 | horizontalTargetValue: 0.1 455 | duration: 0.2 456 | -------------------------------------------------------------------------------- /Assets/Demo/ScaleScrollRect.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6e814094b686d8145b6a54a6e70607b2 3 | timeCreated: 1493966833 4 | licenseType: Pro 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Demo/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 38f39d5416d65c848acd1bf8a6fe769b 3 | folderAsset: yes 4 | timeCreated: 1439609534 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Demo/Scripts/ScrollIndexCallback1.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEngine.UI; 3 | using System.Collections; 4 | 5 | public class ScrollIndexCallback1 : MonoBehaviour 6 | { 7 | public Image image; 8 | public Text text; 9 | 10 | void ScrollCellIndex (int idx) 11 | { 12 | string name = "Cell " + idx.ToString (); 13 | if (text != null) 14 | { 15 | text.text = name; 16 | } 17 | if (image != null) 18 | { 19 | image.color = Rainbow(idx / 50.0f); 20 | } 21 | gameObject.name = name; 22 | } 23 | 24 | // http://stackoverflow.com/questions/2288498/how-do-i-get-a-rainbow-color-gradient-in-c 25 | public static Color Rainbow(float progress) 26 | { 27 | progress = Mathf.Clamp01(progress); 28 | float r = 0.0f; 29 | float g = 0.0f; 30 | float b = 0.0f; 31 | int i = (int)(progress * 6); 32 | float f = progress * 6.0f - i; 33 | float q = 1 - f; 34 | 35 | switch (i % 6) 36 | { 37 | case 0: 38 | r = 1; 39 | g = f; 40 | b = 0; 41 | break; 42 | case 1: 43 | r = q; 44 | g = 1; 45 | b = 0; 46 | break; 47 | case 2: 48 | r = 0; 49 | g = 1; 50 | b = f; 51 | break; 52 | case 3: 53 | r = 0; 54 | g = q; 55 | b = 1; 56 | break; 57 | case 4: 58 | r = f; 59 | g = 0; 60 | b = 1; 61 | break; 62 | case 5: 63 | r = 1; 64 | g = 0; 65 | b = q; 66 | break; 67 | } 68 | return new Color(r, g, b); 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /Assets/Demo/Scripts/ScrollIndexCallback1.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: aae79c5fe0add56479237307a95fbb7f 3 | timeCreated: 1439396433 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/Demo/Scripts/ScrollIndexCallback2.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEngine.UI; 3 | using System.Collections; 4 | 5 | public class ScrollIndexCallback2 : MonoBehaviour 6 | { 7 | public Text text; 8 | public LayoutElement element; 9 | private static float[] randomWidths = new float[3] { 100, 150, 50 }; 10 | void ScrollCellIndex(int idx) 11 | { 12 | string name = "Cell " + idx.ToString(); 13 | if (text != null) 14 | { 15 | text.text = name; 16 | } 17 | element.preferredWidth = randomWidths[Mathf.Abs(idx) % 3]; 18 | gameObject.name = name; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Assets/Demo/Scripts/ScrollIndexCallback2.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4d2a1b5a8e8308e4fbd894c93c0caa09 3 | timeCreated: 1439607769 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/Demo/Scripts/ScrollIndexCallback3.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEngine.UI; 3 | using System.Collections; 4 | 5 | public class ScrollIndexCallback3 : MonoBehaviour 6 | { 7 | public Text text; 8 | void ScrollCellIndex(int idx) 9 | { 10 | string name = "Cell " + idx.ToString(); 11 | if (text != null) 12 | { 13 | text.text = name; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Assets/Demo/Scripts/ScrollIndexCallback3.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 485315e3fd2b43d4d8d15c437f7f01d3 3 | timeCreated: 1439608418 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/Resources.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c18a7cc5c0a1a674989b70139883fc70 3 | folderAsset: yes 4 | timeCreated: 1493101131 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Resources/Prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 92b4f97b6841a70428acacd66fa8d6a9 3 | folderAsset: yes 4 | timeCreated: 1493030515 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Resources/Prefab/ImageCard.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 45ee184aaa1403e419a946d0f91b7641 3 | timeCreated: 1493967224 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Resources/Prefab/RoleCard.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &141320 4 | GameObject: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 100100000} 8 | serializedVersion: 5 9 | m_Component: 10 | - component: {fileID: 22463586} 11 | - component: {fileID: 22269702} 12 | - component: {fileID: 11407168} 13 | m_Layer: 5 14 | m_Name: Frame 15 | m_TagString: Untagged 16 | m_Icon: {fileID: 0} 17 | m_NavMeshLayer: 0 18 | m_StaticEditorFlags: 0 19 | m_IsActive: 1 20 | --- !u!1 &161344 21 | GameObject: 22 | m_ObjectHideFlags: 0 23 | m_PrefabParentObject: {fileID: 0} 24 | m_PrefabInternal: {fileID: 100100000} 25 | serializedVersion: 5 26 | m_Component: 27 | - component: {fileID: 22442812} 28 | - component: {fileID: 22251988} 29 | - component: {fileID: 22564756} 30 | - component: {fileID: 114675479049722732} 31 | - component: {fileID: 114029359630849754} 32 | m_Layer: 5 33 | m_Name: RoleCard 34 | m_TagString: Untagged 35 | m_Icon: {fileID: 0} 36 | m_NavMeshLayer: 0 37 | m_StaticEditorFlags: 0 38 | m_IsActive: 1 39 | --- !u!1 &176618 40 | GameObject: 41 | m_ObjectHideFlags: 0 42 | m_PrefabParentObject: {fileID: 0} 43 | m_PrefabInternal: {fileID: 100100000} 44 | serializedVersion: 5 45 | m_Component: 46 | - component: {fileID: 22418906} 47 | - component: {fileID: 22288252} 48 | - component: {fileID: 11473474} 49 | m_Layer: 5 50 | m_Name: Bg 51 | m_TagString: Untagged 52 | m_Icon: {fileID: 0} 53 | m_NavMeshLayer: 0 54 | m_StaticEditorFlags: 0 55 | m_IsActive: 1 56 | --- !u!1 &181338 57 | GameObject: 58 | m_ObjectHideFlags: 0 59 | m_PrefabParentObject: {fileID: 0} 60 | m_PrefabInternal: {fileID: 100100000} 61 | serializedVersion: 5 62 | m_Component: 63 | - component: {fileID: 22490488} 64 | - component: {fileID: 22203434} 65 | - component: {fileID: 11424444} 66 | m_Layer: 5 67 | m_Name: RoleIcon 68 | m_TagString: Untagged 69 | m_Icon: {fileID: 0} 70 | m_NavMeshLayer: 0 71 | m_StaticEditorFlags: 0 72 | m_IsActive: 1 73 | --- !u!114 &11407168 74 | MonoBehaviour: 75 | m_ObjectHideFlags: 1 76 | m_PrefabParentObject: {fileID: 0} 77 | m_PrefabInternal: {fileID: 100100000} 78 | m_GameObject: {fileID: 141320} 79 | m_Enabled: 1 80 | m_EditorHideFlags: 0 81 | m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} 82 | m_Name: 83 | m_EditorClassIdentifier: 84 | m_Material: {fileID: 0} 85 | m_Color: {r: 1, g: 1, b: 1, a: 1} 86 | m_RaycastTarget: 1 87 | m_OnCullStateChanged: 88 | m_PersistentCalls: 89 | m_Calls: [] 90 | m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, 91 | Version=1.0.0.0, Culture=neutral, PublicKeyToken=null 92 | m_Sprite: {fileID: 21300000, guid: cb0425c5811991048be275dd45471b74, type: 3} 93 | m_Type: 0 94 | m_PreserveAspect: 0 95 | m_FillCenter: 1 96 | m_FillMethod: 4 97 | m_FillAmount: 1 98 | m_FillClockwise: 1 99 | m_FillOrigin: 0 100 | --- !u!114 &11424444 101 | MonoBehaviour: 102 | m_ObjectHideFlags: 1 103 | m_PrefabParentObject: {fileID: 0} 104 | m_PrefabInternal: {fileID: 100100000} 105 | m_GameObject: {fileID: 181338} 106 | m_Enabled: 1 107 | m_EditorHideFlags: 0 108 | m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} 109 | m_Name: 110 | m_EditorClassIdentifier: 111 | m_Material: {fileID: 0} 112 | m_Color: {r: 1, g: 1, b: 1, a: 1} 113 | m_RaycastTarget: 1 114 | m_OnCullStateChanged: 115 | m_PersistentCalls: 116 | m_Calls: [] 117 | m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, 118 | Version=1.0.0.0, Culture=neutral, PublicKeyToken=null 119 | m_Sprite: {fileID: 21300000, guid: 50d9fff5757a1164eb53609a10bbf684, type: 3} 120 | m_Type: 0 121 | m_PreserveAspect: 0 122 | m_FillCenter: 1 123 | m_FillMethod: 4 124 | m_FillAmount: 1 125 | m_FillClockwise: 1 126 | m_FillOrigin: 0 127 | --- !u!114 &11473474 128 | MonoBehaviour: 129 | m_ObjectHideFlags: 1 130 | m_PrefabParentObject: {fileID: 0} 131 | m_PrefabInternal: {fileID: 100100000} 132 | m_GameObject: {fileID: 176618} 133 | m_Enabled: 1 134 | m_EditorHideFlags: 0 135 | m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} 136 | m_Name: 137 | m_EditorClassIdentifier: 138 | m_Material: {fileID: 0} 139 | m_Color: {r: 1, g: 1, b: 1, a: 1} 140 | m_RaycastTarget: 1 141 | m_OnCullStateChanged: 142 | m_PersistentCalls: 143 | m_Calls: [] 144 | m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, 145 | Version=1.0.0.0, Culture=neutral, PublicKeyToken=null 146 | m_Sprite: {fileID: 21300000, guid: dd1794abc0e82c645b59164bf2685700, type: 3} 147 | m_Type: 0 148 | m_PreserveAspect: 0 149 | m_FillCenter: 1 150 | m_FillMethod: 4 151 | m_FillAmount: 1 152 | m_FillClockwise: 1 153 | m_FillOrigin: 0 154 | --- !u!222 &22203434 155 | CanvasRenderer: 156 | m_ObjectHideFlags: 1 157 | m_PrefabParentObject: {fileID: 0} 158 | m_PrefabInternal: {fileID: 100100000} 159 | m_GameObject: {fileID: 181338} 160 | --- !u!222 &22251988 161 | CanvasRenderer: 162 | m_ObjectHideFlags: 1 163 | m_PrefabParentObject: {fileID: 0} 164 | m_PrefabInternal: {fileID: 100100000} 165 | m_GameObject: {fileID: 161344} 166 | --- !u!222 &22269702 167 | CanvasRenderer: 168 | m_ObjectHideFlags: 1 169 | m_PrefabParentObject: {fileID: 0} 170 | m_PrefabInternal: {fileID: 100100000} 171 | m_GameObject: {fileID: 141320} 172 | --- !u!222 &22288252 173 | CanvasRenderer: 174 | m_ObjectHideFlags: 1 175 | m_PrefabParentObject: {fileID: 0} 176 | m_PrefabInternal: {fileID: 100100000} 177 | m_GameObject: {fileID: 176618} 178 | --- !u!224 &22418906 179 | RectTransform: 180 | m_ObjectHideFlags: 1 181 | m_PrefabParentObject: {fileID: 0} 182 | m_PrefabInternal: {fileID: 100100000} 183 | m_GameObject: {fileID: 176618} 184 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 185 | m_LocalPosition: {x: 0, y: 0, z: 0} 186 | m_LocalScale: {x: 1, y: 1, z: 1} 187 | m_Children: [] 188 | m_Father: {fileID: 22442812} 189 | m_RootOrder: 0 190 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 191 | m_AnchorMin: {x: 0.5, y: 0.5} 192 | m_AnchorMax: {x: 0.5, y: 0.5} 193 | m_AnchoredPosition: {x: 0, y: 0} 194 | m_SizeDelta: {x: 164, y: 244} 195 | m_Pivot: {x: 0.5, y: 0.5} 196 | --- !u!224 &22442812 197 | RectTransform: 198 | m_ObjectHideFlags: 1 199 | m_PrefabParentObject: {fileID: 0} 200 | m_PrefabInternal: {fileID: 100100000} 201 | m_GameObject: {fileID: 161344} 202 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 203 | m_LocalPosition: {x: 0, y: 0, z: 0} 204 | m_LocalScale: {x: 1, y: 1, z: 1} 205 | m_Children: 206 | - {fileID: 22418906} 207 | - {fileID: 22463586} 208 | - {fileID: 22490488} 209 | m_Father: {fileID: 0} 210 | m_RootOrder: 0 211 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 212 | m_AnchorMin: {x: 0, y: 0} 213 | m_AnchorMax: {x: 0, y: 0} 214 | m_AnchoredPosition: {x: 0, y: 0} 215 | m_SizeDelta: {x: 0, y: 0} 216 | m_Pivot: {x: 0.5, y: 0.5} 217 | --- !u!224 &22463586 218 | RectTransform: 219 | m_ObjectHideFlags: 1 220 | m_PrefabParentObject: {fileID: 0} 221 | m_PrefabInternal: {fileID: 100100000} 222 | m_GameObject: {fileID: 141320} 223 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 224 | m_LocalPosition: {x: 0, y: 0, z: 0} 225 | m_LocalScale: {x: 1, y: 1, z: 1} 226 | m_Children: [] 227 | m_Father: {fileID: 22442812} 228 | m_RootOrder: 1 229 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 230 | m_AnchorMin: {x: 0.5, y: 0.5} 231 | m_AnchorMax: {x: 0.5, y: 0.5} 232 | m_AnchoredPosition: {x: 0, y: 1.4} 233 | m_SizeDelta: {x: 170, y: 248} 234 | m_Pivot: {x: 0.5, y: 0.5} 235 | --- !u!224 &22490488 236 | RectTransform: 237 | m_ObjectHideFlags: 1 238 | m_PrefabParentObject: {fileID: 0} 239 | m_PrefabInternal: {fileID: 100100000} 240 | m_GameObject: {fileID: 181338} 241 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 242 | m_LocalPosition: {x: 0, y: 0, z: 0} 243 | m_LocalScale: {x: 1, y: 1, z: 1} 244 | m_Children: [] 245 | m_Father: {fileID: 22442812} 246 | m_RootOrder: 2 247 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 248 | m_AnchorMin: {x: 0.5, y: 0.5} 249 | m_AnchorMax: {x: 0.5, y: 0.5} 250 | m_AnchoredPosition: {x: 0, y: 1.4000015} 251 | m_SizeDelta: {x: 160, y: 235} 252 | m_Pivot: {x: 0.5, y: 0.5} 253 | --- !u!225 &22564756 254 | CanvasGroup: 255 | m_ObjectHideFlags: 1 256 | m_PrefabParentObject: {fileID: 0} 257 | m_PrefabInternal: {fileID: 100100000} 258 | m_GameObject: {fileID: 161344} 259 | m_Enabled: 1 260 | m_Alpha: 1 261 | m_Interactable: 1 262 | m_BlocksRaycasts: 1 263 | m_IgnoreParentGroups: 0 264 | --- !u!1001 &100100000 265 | Prefab: 266 | m_ObjectHideFlags: 1 267 | serializedVersion: 2 268 | m_Modification: 269 | m_TransformParent: {fileID: 0} 270 | m_Modifications: 271 | - target: {fileID: 0} 272 | propertyPath: m_CanvasGroup 273 | value: 274 | objectReference: {fileID: 22564756} 275 | m_RemovedComponents: [] 276 | m_ParentPrefab: {fileID: 0} 277 | m_RootGameObject: {fileID: 161344} 278 | m_IsPrefabParent: 1 279 | --- !u!114 &114029359630849754 280 | MonoBehaviour: 281 | m_ObjectHideFlags: 1 282 | m_PrefabParentObject: {fileID: 0} 283 | m_PrefabInternal: {fileID: 100100000} 284 | m_GameObject: {fileID: 161344} 285 | m_Enabled: 1 286 | m_EditorHideFlags: 0 287 | m_Script: {fileID: 11500000, guid: 00bb43a4f3663a841a8b315b4b700852, type: 3} 288 | m_Name: 289 | m_EditorClassIdentifier: 290 | RoleIcon: {fileID: 11424444} 291 | m_CanvasGroup: {fileID: 22564756} 292 | --- !u!114 &114675479049722732 293 | MonoBehaviour: 294 | m_ObjectHideFlags: 1 295 | m_PrefabParentObject: {fileID: 0} 296 | m_PrefabInternal: {fileID: 100100000} 297 | m_GameObject: {fileID: 161344} 298 | m_Enabled: 1 299 | m_EditorHideFlags: 0 300 | m_Script: {fileID: 1392445389, guid: f70555f144d8491a825f0804e09c671c, type: 3} 301 | m_Name: 302 | m_EditorClassIdentifier: 303 | m_Navigation: 304 | m_Mode: 3 305 | m_SelectOnUp: {fileID: 0} 306 | m_SelectOnDown: {fileID: 0} 307 | m_SelectOnLeft: {fileID: 0} 308 | m_SelectOnRight: {fileID: 0} 309 | m_Transition: 3 310 | m_Colors: 311 | m_NormalColor: {r: 1, g: 1, b: 1, a: 1} 312 | m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} 313 | m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} 314 | m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} 315 | m_ColorMultiplier: 1 316 | m_FadeDuration: 0.1 317 | m_SpriteState: 318 | m_HighlightedSprite: {fileID: 0} 319 | m_PressedSprite: {fileID: 0} 320 | m_DisabledSprite: {fileID: 0} 321 | m_AnimationTriggers: 322 | m_NormalTrigger: Normal 323 | m_HighlightedTrigger: Highlighted 324 | m_PressedTrigger: Pressed 325 | m_DisabledTrigger: Disabled 326 | m_Interactable: 1 327 | m_TargetGraphic: {fileID: 0} 328 | m_OnClick: 329 | m_PersistentCalls: 330 | m_Calls: [] 331 | m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, 332 | Culture=neutral, PublicKeyToken=null 333 | -------------------------------------------------------------------------------- /Assets/Resources/Prefab/RoleCard.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 908ca160e1d3e2249b13c324c72cb7b2 3 | timeCreated: 1493031321 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Resources/Texture.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7cb7aa6262857ac4e90b8ec2671f9db8 3 | folderAsset: yes 4 | timeCreated: 1493030515 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Resources/Texture/RO_lv0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dingxiaowei/ScrollRect/2b7c592adbf1d8dbb796e752640e57c2b4ab6337/Assets/Resources/Texture/RO_lv0.png -------------------------------------------------------------------------------- /Assets/Resources/Texture/RO_lv0.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 50d9fff5757a1164eb53609a10bbf684 3 | timeCreated: 1493030516 4 | licenseType: Pro 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 2 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 1 11 | linearTexture: 0 12 | correctGamma: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: .25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 0 25 | cubemapConvolution: 0 26 | cubemapConvolutionSteps: 8 27 | cubemapConvolutionExponent: 1.5 28 | seamlessCubemap: 0 29 | textureFormat: -3 30 | maxTextureSize: 2048 31 | textureSettings: 32 | filterMode: -1 33 | aniso: 16 34 | mipBias: -1 35 | wrapMode: 1 36 | nPOTScale: 0 37 | lightmap: 0 38 | rGBM: 0 39 | compressionQuality: 50 40 | allowsAlphaSplitting: 0 41 | spriteMode: 1 42 | spriteExtrude: 1 43 | spriteMeshType: 1 44 | alignment: 0 45 | spritePivot: {x: .5, y: .5} 46 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 47 | spritePixelsToUnits: 100 48 | alphaIsTransparency: 1 49 | textureType: 8 50 | buildTargetSettings: [] 51 | spriteSheet: 52 | sprites: [] 53 | spritePackingTag: 54 | userData: 55 | assetBundleName: 56 | assetBundleVariant: 57 | -------------------------------------------------------------------------------- /Assets/Resources/Texture/RO_lv120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dingxiaowei/ScrollRect/2b7c592adbf1d8dbb796e752640e57c2b4ab6337/Assets/Resources/Texture/RO_lv120.png -------------------------------------------------------------------------------- /Assets/Resources/Texture/RO_lv120.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e419d39cf52d5c64dafce3f07a91f435 3 | timeCreated: 1493030516 4 | licenseType: Pro 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 2 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 1 11 | linearTexture: 0 12 | correctGamma: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: .25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 0 25 | cubemapConvolution: 0 26 | cubemapConvolutionSteps: 8 27 | cubemapConvolutionExponent: 1.5 28 | seamlessCubemap: 0 29 | textureFormat: -3 30 | maxTextureSize: 2048 31 | textureSettings: 32 | filterMode: -1 33 | aniso: 16 34 | mipBias: -1 35 | wrapMode: 1 36 | nPOTScale: 0 37 | lightmap: 0 38 | rGBM: 0 39 | compressionQuality: 50 40 | allowsAlphaSplitting: 0 41 | spriteMode: 1 42 | spriteExtrude: 1 43 | spriteMeshType: 1 44 | alignment: 0 45 | spritePivot: {x: .5, y: .5} 46 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 47 | spritePixelsToUnits: 100 48 | alphaIsTransparency: 1 49 | textureType: 8 50 | buildTargetSettings: [] 51 | spriteSheet: 52 | sprites: [] 53 | spritePackingTag: 54 | userData: 55 | assetBundleName: 56 | assetBundleVariant: 57 | -------------------------------------------------------------------------------- /Assets/Resources/Texture/UI_CardBG.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dingxiaowei/ScrollRect/2b7c592adbf1d8dbb796e752640e57c2b4ab6337/Assets/Resources/Texture/UI_CardBG.png -------------------------------------------------------------------------------- /Assets/Resources/Texture/UI_CardBG.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cb0425c5811991048be275dd45471b74 3 | timeCreated: 1493030881 4 | licenseType: Pro 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 2 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 1 11 | linearTexture: 0 12 | correctGamma: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: .25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 0 25 | cubemapConvolution: 0 26 | cubemapConvolutionSteps: 8 27 | cubemapConvolutionExponent: 1.5 28 | seamlessCubemap: 0 29 | textureFormat: -1 30 | maxTextureSize: 2048 31 | textureSettings: 32 | filterMode: -1 33 | aniso: 16 34 | mipBias: -1 35 | wrapMode: 1 36 | nPOTScale: 0 37 | lightmap: 0 38 | rGBM: 0 39 | compressionQuality: 50 40 | allowsAlphaSplitting: 0 41 | spriteMode: 1 42 | spriteExtrude: 1 43 | spriteMeshType: 1 44 | alignment: 0 45 | spritePivot: {x: .5, y: .5} 46 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 47 | spritePixelsToUnits: 100 48 | alphaIsTransparency: 1 49 | textureType: 8 50 | buildTargetSettings: [] 51 | spriteSheet: 52 | sprites: [] 53 | spritePackingTag: 54 | userData: 55 | assetBundleName: 56 | assetBundleVariant: 57 | -------------------------------------------------------------------------------- /Assets/Resources/Texture/UI_Cardbg1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dingxiaowei/ScrollRect/2b7c592adbf1d8dbb796e752640e57c2b4ab6337/Assets/Resources/Texture/UI_Cardbg1.png -------------------------------------------------------------------------------- /Assets/Resources/Texture/UI_Cardbg1.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dd1794abc0e82c645b59164bf2685700 3 | timeCreated: 1493030881 4 | licenseType: Pro 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 2 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 1 11 | linearTexture: 0 12 | correctGamma: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: .25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 0 25 | cubemapConvolution: 0 26 | cubemapConvolutionSteps: 8 27 | cubemapConvolutionExponent: 1.5 28 | seamlessCubemap: 0 29 | textureFormat: -1 30 | maxTextureSize: 2048 31 | textureSettings: 32 | filterMode: -1 33 | aniso: 16 34 | mipBias: -1 35 | wrapMode: 1 36 | nPOTScale: 0 37 | lightmap: 0 38 | rGBM: 0 39 | compressionQuality: 50 40 | allowsAlphaSplitting: 0 41 | spriteMode: 1 42 | spriteExtrude: 1 43 | spriteMeshType: 1 44 | alignment: 0 45 | spritePivot: {x: .5, y: .5} 46 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 47 | spritePixelsToUnits: 100 48 | alphaIsTransparency: 1 49 | textureType: 8 50 | buildTargetSettings: [] 51 | spriteSheet: 52 | sprites: [] 53 | spritePackingTag: 54 | userData: 55 | assetBundleName: 56 | assetBundleVariant: 57 | -------------------------------------------------------------------------------- /Assets/Resources/Texture/card_bg_big_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dingxiaowei/ScrollRect/2b7c592adbf1d8dbb796e752640e57c2b4ab6337/Assets/Resources/Texture/card_bg_big_1.jpg -------------------------------------------------------------------------------- /Assets/Resources/Texture/card_bg_big_1.jpg.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c01132da2d4badc4fbad6f0c41a087d1 3 | timeCreated: 1493966557 4 | licenseType: Pro 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 4 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 0 11 | sRGBTexture: 1 12 | linearTexture: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: 0.25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 6 25 | cubemapConvolution: 0 26 | seamlessCubemap: 0 27 | textureFormat: 1 28 | maxTextureSize: 2048 29 | textureSettings: 30 | filterMode: -1 31 | aniso: -1 32 | mipBias: -1 33 | wrapMode: 1 34 | nPOTScale: 0 35 | lightmap: 0 36 | compressionQuality: 50 37 | spriteMode: 1 38 | spriteExtrude: 1 39 | spriteMeshType: 1 40 | alignment: 0 41 | spritePivot: {x: 0.5, y: 0.5} 42 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 43 | spritePixelsToUnits: 100 44 | alphaUsage: 1 45 | alphaIsTransparency: 1 46 | spriteTessellationDetail: -1 47 | textureType: 8 48 | textureShape: 1 49 | maxTextureSizeSet: 0 50 | compressionQualitySet: 0 51 | textureFormatSet: 0 52 | platformSettings: 53 | - buildTarget: DefaultTexturePlatform 54 | maxTextureSize: 2048 55 | textureFormat: -1 56 | textureCompression: 1 57 | compressionQuality: 50 58 | crunchedCompression: 0 59 | allowsAlphaSplitting: 0 60 | overridden: 0 61 | - buildTarget: Standalone 62 | maxTextureSize: 2048 63 | textureFormat: -1 64 | textureCompression: 1 65 | compressionQuality: 50 66 | crunchedCompression: 0 67 | allowsAlphaSplitting: 0 68 | overridden: 0 69 | spriteSheet: 70 | serializedVersion: 2 71 | sprites: [] 72 | outline: [] 73 | spritePackingTag: 74 | userData: 75 | assetBundleName: 76 | assetBundleVariant: 77 | -------------------------------------------------------------------------------- /Assets/Resources/Texture/card_bg_big_2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dingxiaowei/ScrollRect/2b7c592adbf1d8dbb796e752640e57c2b4ab6337/Assets/Resources/Texture/card_bg_big_2.jpg -------------------------------------------------------------------------------- /Assets/Resources/Texture/card_bg_big_2.jpg.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 50552b46a491be5469394a1cf322de57 3 | timeCreated: 1493966556 4 | licenseType: Pro 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 4 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 0 11 | sRGBTexture: 1 12 | linearTexture: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: 0.25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 6 25 | cubemapConvolution: 0 26 | seamlessCubemap: 0 27 | textureFormat: 1 28 | maxTextureSize: 2048 29 | textureSettings: 30 | filterMode: -1 31 | aniso: -1 32 | mipBias: -1 33 | wrapMode: 1 34 | nPOTScale: 0 35 | lightmap: 0 36 | compressionQuality: 50 37 | spriteMode: 1 38 | spriteExtrude: 1 39 | spriteMeshType: 1 40 | alignment: 0 41 | spritePivot: {x: 0.5, y: 0.5} 42 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 43 | spritePixelsToUnits: 100 44 | alphaUsage: 1 45 | alphaIsTransparency: 1 46 | spriteTessellationDetail: -1 47 | textureType: 8 48 | textureShape: 1 49 | maxTextureSizeSet: 0 50 | compressionQualitySet: 0 51 | textureFormatSet: 0 52 | platformSettings: 53 | - buildTarget: DefaultTexturePlatform 54 | maxTextureSize: 2048 55 | textureFormat: -1 56 | textureCompression: 1 57 | compressionQuality: 50 58 | crunchedCompression: 0 59 | allowsAlphaSplitting: 0 60 | overridden: 0 61 | - buildTarget: Standalone 62 | maxTextureSize: 2048 63 | textureFormat: -1 64 | textureCompression: 1 65 | compressionQuality: 50 66 | crunchedCompression: 0 67 | allowsAlphaSplitting: 0 68 | overridden: 0 69 | spriteSheet: 70 | serializedVersion: 2 71 | sprites: [] 72 | outline: [] 73 | spritePackingTag: 74 | userData: 75 | assetBundleName: 76 | assetBundleVariant: 77 | -------------------------------------------------------------------------------- /Assets/Resources/Texture/card_bg_big_3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dingxiaowei/ScrollRect/2b7c592adbf1d8dbb796e752640e57c2b4ab6337/Assets/Resources/Texture/card_bg_big_3.jpg -------------------------------------------------------------------------------- /Assets/Resources/Texture/card_bg_big_3.jpg.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 58e534ca3daedcb4e8ed7d9128ee0a6f 3 | timeCreated: 1493966556 4 | licenseType: Pro 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 4 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 0 11 | sRGBTexture: 1 12 | linearTexture: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: 0.25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 6 25 | cubemapConvolution: 0 26 | seamlessCubemap: 0 27 | textureFormat: 1 28 | maxTextureSize: 2048 29 | textureSettings: 30 | filterMode: -1 31 | aniso: -1 32 | mipBias: -1 33 | wrapMode: 1 34 | nPOTScale: 0 35 | lightmap: 0 36 | compressionQuality: 50 37 | spriteMode: 1 38 | spriteExtrude: 1 39 | spriteMeshType: 1 40 | alignment: 0 41 | spritePivot: {x: 0.5, y: 0.5} 42 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 43 | spritePixelsToUnits: 100 44 | alphaUsage: 1 45 | alphaIsTransparency: 1 46 | spriteTessellationDetail: -1 47 | textureType: 8 48 | textureShape: 1 49 | maxTextureSizeSet: 0 50 | compressionQualitySet: 0 51 | textureFormatSet: 0 52 | platformSettings: 53 | - buildTarget: DefaultTexturePlatform 54 | maxTextureSize: 2048 55 | textureFormat: -1 56 | textureCompression: 1 57 | compressionQuality: 50 58 | crunchedCompression: 0 59 | allowsAlphaSplitting: 0 60 | overridden: 0 61 | - buildTarget: Standalone 62 | maxTextureSize: 2048 63 | textureFormat: -1 64 | textureCompression: 1 65 | compressionQuality: 50 66 | crunchedCompression: 0 67 | allowsAlphaSplitting: 0 68 | overridden: 0 69 | spriteSheet: 70 | serializedVersion: 2 71 | sprites: [] 72 | outline: [] 73 | spritePackingTag: 74 | userData: 75 | assetBundleName: 76 | assetBundleVariant: 77 | -------------------------------------------------------------------------------- /Assets/Resources/Texture/card_bg_big_4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dingxiaowei/ScrollRect/2b7c592adbf1d8dbb796e752640e57c2b4ab6337/Assets/Resources/Texture/card_bg_big_4.jpg -------------------------------------------------------------------------------- /Assets/Resources/Texture/card_bg_big_4.jpg.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a7e2e467343f43e498cd3e24bf91856c 3 | timeCreated: 1493966556 4 | licenseType: Pro 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 4 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 0 11 | sRGBTexture: 1 12 | linearTexture: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: 0.25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 6 25 | cubemapConvolution: 0 26 | seamlessCubemap: 0 27 | textureFormat: 1 28 | maxTextureSize: 2048 29 | textureSettings: 30 | filterMode: -1 31 | aniso: -1 32 | mipBias: -1 33 | wrapMode: 1 34 | nPOTScale: 0 35 | lightmap: 0 36 | compressionQuality: 50 37 | spriteMode: 1 38 | spriteExtrude: 1 39 | spriteMeshType: 1 40 | alignment: 0 41 | spritePivot: {x: 0.5, y: 0.5} 42 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 43 | spritePixelsToUnits: 100 44 | alphaUsage: 1 45 | alphaIsTransparency: 1 46 | spriteTessellationDetail: -1 47 | textureType: 8 48 | textureShape: 1 49 | maxTextureSizeSet: 0 50 | compressionQualitySet: 0 51 | textureFormatSet: 0 52 | platformSettings: 53 | - buildTarget: DefaultTexturePlatform 54 | maxTextureSize: 2048 55 | textureFormat: -1 56 | textureCompression: 1 57 | compressionQuality: 50 58 | crunchedCompression: 0 59 | allowsAlphaSplitting: 0 60 | overridden: 0 61 | - buildTarget: Standalone 62 | maxTextureSize: 2048 63 | textureFormat: -1 64 | textureCompression: 1 65 | compressionQuality: 50 66 | crunchedCompression: 0 67 | allowsAlphaSplitting: 0 68 | overridden: 0 69 | spriteSheet: 70 | serializedVersion: 2 71 | sprites: [] 72 | outline: [] 73 | spritePackingTag: 74 | userData: 75 | assetBundleName: 76 | assetBundleVariant: 77 | -------------------------------------------------------------------------------- /Assets/Resources/Texture/card_bg_big_5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dingxiaowei/ScrollRect/2b7c592adbf1d8dbb796e752640e57c2b4ab6337/Assets/Resources/Texture/card_bg_big_5.jpg -------------------------------------------------------------------------------- /Assets/Resources/Texture/card_bg_big_5.jpg.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 61d2d1d6bce755a428efd7875610f086 3 | timeCreated: 1493966556 4 | licenseType: Pro 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 4 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 0 11 | sRGBTexture: 1 12 | linearTexture: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: 0.25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 6 25 | cubemapConvolution: 0 26 | seamlessCubemap: 0 27 | textureFormat: 1 28 | maxTextureSize: 2048 29 | textureSettings: 30 | filterMode: -1 31 | aniso: -1 32 | mipBias: -1 33 | wrapMode: 1 34 | nPOTScale: 0 35 | lightmap: 0 36 | compressionQuality: 50 37 | spriteMode: 1 38 | spriteExtrude: 1 39 | spriteMeshType: 1 40 | alignment: 0 41 | spritePivot: {x: 0.5, y: 0.5} 42 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 43 | spritePixelsToUnits: 100 44 | alphaUsage: 1 45 | alphaIsTransparency: 1 46 | spriteTessellationDetail: -1 47 | textureType: 8 48 | textureShape: 1 49 | maxTextureSizeSet: 0 50 | compressionQualitySet: 0 51 | textureFormatSet: 0 52 | platformSettings: 53 | - buildTarget: DefaultTexturePlatform 54 | maxTextureSize: 2048 55 | textureFormat: -1 56 | textureCompression: 1 57 | compressionQuality: 50 58 | crunchedCompression: 0 59 | allowsAlphaSplitting: 0 60 | overridden: 0 61 | - buildTarget: Standalone 62 | maxTextureSize: 2048 63 | textureFormat: -1 64 | textureCompression: 1 65 | compressionQuality: 50 66 | crunchedCompression: 0 67 | allowsAlphaSplitting: 0 68 | overridden: 0 69 | spriteSheet: 70 | serializedVersion: 2 71 | sprites: [] 72 | outline: [] 73 | spritePackingTag: 74 | userData: 75 | assetBundleName: 76 | assetBundleVariant: 77 | -------------------------------------------------------------------------------- /Assets/Resources/Texture/card_bg_big_6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dingxiaowei/ScrollRect/2b7c592adbf1d8dbb796e752640e57c2b4ab6337/Assets/Resources/Texture/card_bg_big_6.jpg -------------------------------------------------------------------------------- /Assets/Resources/Texture/card_bg_big_6.jpg.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4c0b1195dff2abb48a77d66a0a30ea8b 3 | timeCreated: 1493966556 4 | licenseType: Pro 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 4 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 0 11 | sRGBTexture: 1 12 | linearTexture: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: 0.25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 6 25 | cubemapConvolution: 0 26 | seamlessCubemap: 0 27 | textureFormat: 1 28 | maxTextureSize: 2048 29 | textureSettings: 30 | filterMode: -1 31 | aniso: -1 32 | mipBias: -1 33 | wrapMode: 1 34 | nPOTScale: 0 35 | lightmap: 0 36 | compressionQuality: 50 37 | spriteMode: 1 38 | spriteExtrude: 1 39 | spriteMeshType: 1 40 | alignment: 0 41 | spritePivot: {x: 0.5, y: 0.5} 42 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 43 | spritePixelsToUnits: 100 44 | alphaUsage: 1 45 | alphaIsTransparency: 1 46 | spriteTessellationDetail: -1 47 | textureType: 8 48 | textureShape: 1 49 | maxTextureSizeSet: 0 50 | compressionQualitySet: 0 51 | textureFormatSet: 0 52 | platformSettings: 53 | - buildTarget: DefaultTexturePlatform 54 | maxTextureSize: 2048 55 | textureFormat: -1 56 | textureCompression: 1 57 | compressionQuality: 50 58 | crunchedCompression: 0 59 | allowsAlphaSplitting: 0 60 | overridden: 0 61 | - buildTarget: Standalone 62 | maxTextureSize: 2048 63 | textureFormat: -1 64 | textureCompression: 1 65 | compressionQuality: 50 66 | crunchedCompression: 0 67 | allowsAlphaSplitting: 0 68 | overridden: 0 69 | spriteSheet: 70 | serializedVersion: 2 71 | sprites: [] 72 | outline: [] 73 | spritePackingTag: 74 | userData: 75 | assetBundleName: 76 | assetBundleVariant: 77 | -------------------------------------------------------------------------------- /Assets/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ec0ddcd49b026ab4fb6b7d49fd693e57 3 | folderAsset: yes 4 | timeCreated: 1439395131 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/AladdinScript.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 92c9af37ca3f5974b8b31a37f8bc257a 3 | folderAsset: yes 4 | timeCreated: 1493101131 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/AladdinScript/CFixGridRect.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using DG.Tweening; 3 | using UnityEngine; 4 | using UnityEngine.EventSystems; 5 | using UnityEngine.UI; 6 | 7 | //TODO:当前只试应横向的ScrollRect,还需要扩展支持纵向 8 | public class CFixGridRect : MonoBehaviour, IEndDragHandler 9 | { 10 | public GameObject content; 11 | public ScrollRect scorllRect; 12 | public float itemWidth; 13 | private RectTransform contentRectTf; 14 | 15 | private float formalPosX = 0; 16 | private float currentPosX = 0; 17 | private float halfItemLength = 0; 18 | 19 | void Start() 20 | { 21 | if (itemWidth <= 0) 22 | UnityEngine.Debug.LogError("请设置Item的宽度"); 23 | halfItemLength = itemWidth / 2; 24 | this.contentRectTf = this.content.GetComponent(); 25 | } 26 | 27 | public void OnEndDrag(PointerEventData eventData) 28 | { 29 | this.scorllRect.StopMovement(); 30 | Vector2 afterDragPagePos = this.content.transform.localPosition; 31 | currentPosX = afterDragPagePos.x; //当前拖动的位置 负 32 | if (scorllRect.horizontalNormalizedPosition < 0 || scorllRect.horizontalNormalizedPosition > 1) 33 | return; 34 | int count = (int)(Mathf.Abs(currentPosX) / itemWidth); 35 | var targetPos = -(float)(count * itemWidth); 36 | 37 | if (((float)(count * itemWidth + halfItemLength)) < Mathf.Abs(currentPosX)) //移动不超过一半 38 | { 39 | targetPos = -(float)((count + 1) * itemWidth); 40 | } 41 | formalPosX = targetPos; 42 | this.contentRectTf.DOLocalMoveX(targetPos, .2f); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Assets/Scripts/AladdinScript/CFixGridRect.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3bde471e3bd86ad4ba6408a395cf29f7 3 | timeCreated: 1493101139 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/AladdinScript/CIgnoreRayCast.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEngine.UI; 3 | using System.Collections; 4 | 5 | namespace Mga 6 | { 7 | public class CIgnoreRayCast : MonoBehaviour, ICanvasRaycastFilter 8 | { 9 | public bool IsRaycastLocationValid(Vector2 sp, Camera eventCamera) 10 | { 11 | return false; 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Assets/Scripts/AladdinScript/CIgnoreRayCast.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 106f46e136b65114bb76ab59cad45055 3 | timeCreated: 1493101139 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/AladdinScript/CPlayedCardOnDrag.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEngine.EventSystems; 3 | using UnityEngine.UI; 4 | 5 | namespace Mga 6 | { 7 | [RequireComponent(typeof(Image))] 8 | public class CPlayedCardOnDrag : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndDragHandler 9 | { 10 | public bool dragOnSurfaces = true; 11 | public ScrollRect m_ScrollRect = null; 12 | public CFixGridRect m_FixGridRect = null; 13 | private GameObject m_DraggingCard; 14 | private RectTransform m_DraggingPlane; 15 | 16 | public bool isVertical = false; 17 | private bool isSelf = false; 18 | 19 | private System.Action m_OnBeginDragCallBack = null; 20 | private System.Action m_OnEndDragCallBack = null; 21 | 22 | private System.Action m_OnBeginScroll = null; 23 | private System.Action m_OnEndScroll = null; 24 | public void Init(CLocalCharInfo roleInfo, System.Action beginCallBack = null, System.Action endCallBack = null, System.Action beginScroll = null, System.Action endScroll = null) 25 | { 26 | m_OnBeginDragCallBack = beginCallBack; 27 | m_OnEndDragCallBack = endCallBack; 28 | m_OnBeginScroll = beginScroll; 29 | m_OnEndScroll = endScroll; 30 | } 31 | public void OnBeginDrag(PointerEventData eventData) 32 | { 33 | Vector2 touchDeltaPosition = Vector2.zero; 34 | #if UNITY_EDITOR 35 | float delta_x = Input.GetAxis("Mouse X"); 36 | float delta_y = Input.GetAxis("Mouse Y"); 37 | touchDeltaPosition = new Vector2(delta_x, delta_y); 38 | 39 | #elif UNITY_ANDROID || UNITY_IPHONE 40 | touchDeltaPosition = Input.GetTouch(0).deltaPosition; 41 | #endif 42 | if (isVertical) 43 | { 44 | if (Mathf.Abs(touchDeltaPosition.x) > Mathf.Abs(touchDeltaPosition.y)) 45 | { 46 | isSelf = true; 47 | var canvas = FindInParents(gameObject); 48 | if (canvas == null) 49 | return; 50 | m_DraggingCard = createCard(); 51 | m_DraggingCard.transform.SetAsLastSibling(); 52 | 53 | m_DraggingCard.AddComponent(); 54 | 55 | if (dragOnSurfaces) 56 | m_DraggingPlane = transform as RectTransform; 57 | else 58 | m_DraggingPlane = canvas.transform as RectTransform; 59 | 60 | SetDraggedPosition(eventData); 61 | if (m_OnBeginDragCallBack != null) 62 | { 63 | m_OnBeginDragCallBack(); 64 | } 65 | } 66 | else 67 | { 68 | isSelf = false; 69 | if (m_ScrollRect != null) 70 | m_ScrollRect.OnBeginDrag(eventData); 71 | } 72 | } 73 | else 74 | { 75 | if (Mathf.Abs(touchDeltaPosition.x) < Mathf.Abs(touchDeltaPosition.y)) 76 | { 77 | isSelf = true; 78 | var canvas = FindInParents(gameObject); 79 | if (canvas == null) 80 | return; 81 | m_DraggingCard = createCard(); 82 | m_DraggingCard.transform.SetAsLastSibling(); 83 | 84 | m_DraggingCard.AddComponent(); 85 | 86 | if (dragOnSurfaces) 87 | m_DraggingPlane = transform as RectTransform; 88 | else 89 | m_DraggingPlane = canvas.transform as RectTransform; 90 | 91 | SetDraggedPosition(eventData); 92 | if (m_OnBeginDragCallBack != null) 93 | { 94 | m_OnBeginDragCallBack(); 95 | } 96 | } 97 | else 98 | { 99 | isSelf = false; 100 | if (m_ScrollRect != null) 101 | m_ScrollRect.OnBeginDrag(eventData); 102 | } 103 | } 104 | if (m_OnBeginScroll != null) 105 | m_OnBeginScroll(); 106 | } 107 | 108 | public void OnDrag(PointerEventData data) 109 | { 110 | if (isSelf) 111 | { 112 | if (m_DraggingCard != null) 113 | { 114 | SetDraggedPosition(data); 115 | } 116 | } 117 | else 118 | { 119 | if (m_ScrollRect != null) 120 | m_ScrollRect.OnDrag(data); 121 | } 122 | } 123 | 124 | private void SetDraggedPosition(PointerEventData data) 125 | { 126 | if (dragOnSurfaces && data.pointerEnter != null && data.pointerEnter.transform as RectTransform != null) 127 | m_DraggingPlane = data.pointerEnter.transform as RectTransform; 128 | 129 | var rt = m_DraggingCard.GetComponent(); 130 | Vector3 globalMousePos; 131 | if (RectTransformUtility.ScreenPointToWorldPointInRectangle(m_DraggingPlane, data.position, data.pressEventCamera, out globalMousePos)) 132 | { 133 | rt.position = globalMousePos; 134 | rt.rotation = m_DraggingPlane.rotation; 135 | } 136 | } 137 | 138 | private GameObject createCard() 139 | { 140 | CUIPlayedCharCardWidget charCardWidget = null; 141 | m_DraggingCard = Instantiate(Resources.Load("Prefab/RoleCard") as GameObject); 142 | if (m_DraggingCard == null) 143 | { 144 | return null; 145 | } 146 | charCardWidget = m_DraggingCard.GetComponent(); 147 | 148 | if (charCardWidget == null) 149 | { 150 | return null; 151 | } 152 | 153 | m_DraggingCard.transform.parent = FindInParents(gameObject).transform; 154 | m_DraggingCard.transform.localScale = Vector3.one; 155 | CUIPlayedCharCardWidget.CUIContent uiContent = new CUIPlayedCharCardWidget.CUIContent(); 156 | 157 | charCardWidget.InitContent(uiContent); 158 | return m_DraggingCard; 159 | } 160 | 161 | public void OnEndDrag(PointerEventData eventData) 162 | { 163 | if (isSelf) 164 | { 165 | if (m_DraggingCard != null) 166 | { 167 | Destroy(m_DraggingCard); 168 | if (m_OnEndDragCallBack != null) 169 | { 170 | m_OnEndDragCallBack(); 171 | } 172 | } 173 | } 174 | else 175 | { 176 | if (m_ScrollRect != null) 177 | m_ScrollRect.OnEndDrag(eventData); 178 | if (m_FixGridRect != null) 179 | m_FixGridRect.OnEndDrag(eventData); 180 | } 181 | 182 | } 183 | 184 | static public T FindInParents(GameObject go) where T : Component 185 | { 186 | if (go == null) return null; 187 | var comp = go.GetComponent(); 188 | 189 | if (comp != null) 190 | return comp; 191 | 192 | Transform t = go.transform.parent; 193 | while (t != null && comp == null) 194 | { 195 | comp = t.gameObject.GetComponent(); 196 | t = t.parent; 197 | } 198 | return comp; 199 | } 200 | } 201 | } 202 | -------------------------------------------------------------------------------- /Assets/Scripts/AladdinScript/CPlayedCardOnDrag.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 74c59b9066a6dab45832bcdb027a0436 3 | timeCreated: 1493101139 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/AladdinScript/CPlayedCardOnDrop.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using UnityEngine; 3 | using UnityEngine.EventSystems; 4 | using UnityEngine.UI; 5 | using System.Collections; 6 | namespace Mga 7 | { 8 | public class CPlayedCardOnDrop : MonoBehaviour, IDropHandler, IPointerEnterHandler, IPointerExitHandler 9 | { 10 | public Image containerImage; 11 | public Image receivingImage; 12 | private Color normalColor; 13 | public Color highlightColor = Color.yellow; 14 | private int drapAreaIndex = 0; 15 | 16 | void Start() 17 | { 18 | drapAreaIndex = System.Convert.ToInt32(this.transform.parent.name); 19 | } 20 | 21 | public void OnEnable() 22 | { 23 | if (containerImage != null) 24 | normalColor = containerImage.color; 25 | } 26 | 27 | public void OnDrop(PointerEventData data) 28 | { 29 | containerImage.color = normalColor; 30 | 31 | if (receivingImage == null) 32 | return; 33 | Sprite dropSprite = GetDropSprite(data); 34 | if (dropSprite != null) 35 | receivingImage.overrideSprite = dropSprite; 36 | } 37 | 38 | public void OnPointerEnter(PointerEventData data) 39 | { 40 | if (containerImage == null) 41 | return; 42 | Sprite dropSprite = GetDropSprite(data); 43 | if (dropSprite != null) 44 | containerImage.color = highlightColor; 45 | } 46 | 47 | public void OnPointerExit(PointerEventData data) 48 | { 49 | if (containerImage == null) 50 | return; 51 | containerImage.color = normalColor; 52 | } 53 | 54 | private Sprite GetDropSprite(PointerEventData data) 55 | { 56 | var originalObj = data.pointerDrag; 57 | if (originalObj == null) 58 | return null; 59 | 60 | var srcImage = originalObj.GetComponent(); 61 | if (srcImage == null) 62 | return null; 63 | 64 | return srcImage.sprite; 65 | } 66 | } 67 | } -------------------------------------------------------------------------------- /Assets/Scripts/AladdinScript/CPlayedCardOnDrop.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e45d2749c2e3430488066b6b5228095a 3 | timeCreated: 1493101139 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/AladdinScript/CUIPlayedCharCardWidget.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using UnityEngine.UI; 4 | 5 | namespace Mga 6 | { 7 | public class CLocalCharInfo 8 | { 9 | public int ID; 10 | public string Name; 11 | } 12 | 13 | public class CUIPlayedCharCardWidget : MonoBehaviour 14 | { 15 | public class CUIContent 16 | { 17 | public string RoleIcon = "RO_lv0"; 18 | public ScrollRect ScrollRectObj; 19 | public CFixGridRect FixGridRect; 20 | public CLocalCharInfo RoleInfo; 21 | public System.Action BeginDrag = null; 22 | public System.Action EndDrag = null; 23 | public System.Action BeginScroll = null; 24 | public System.Action EndScroll = null; 25 | } 26 | public Image RoleIcon; 27 | private CUIContent m_uiContent; 28 | public CanvasGroup m_CanvasGroup; 29 | 30 | void Start() 31 | { 32 | 33 | } 34 | public void InitContent(CUIContent uiContent) 35 | { 36 | m_uiContent = uiContent; 37 | _initContent(); 38 | } 39 | private void _initContent() 40 | { 41 | if (m_uiContent == null) return; 42 | 43 | if (RoleIcon != null) 44 | { 45 | RoleIcon.sprite = Resources.Load("Texture/" + m_uiContent.RoleIcon); 46 | var dragSrc = RoleIcon.gameObject.AddComponent(); 47 | dragSrc.m_ScrollRect = m_uiContent.ScrollRectObj; 48 | dragSrc.m_FixGridRect = m_uiContent.FixGridRect; 49 | dragSrc.dragOnSurfaces = true; 50 | dragSrc.Init(m_uiContent.RoleInfo, m_uiContent.BeginDrag, m_uiContent.EndDrag, m_uiContent.BeginScroll, m_uiContent.EndScroll); 51 | } 52 | } 53 | 54 | public void SetState(bool state) 55 | { 56 | m_CanvasGroup.alpha = state ? 1 : 0; 57 | } 58 | } 59 | } -------------------------------------------------------------------------------- /Assets/Scripts/AladdinScript/CUIPlayedCharCardWidget.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 00bb43a4f3663a841a8b315b4b700852 3 | timeCreated: 1493101139 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/AladdinScript/CUIShowCardsPanel.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using UnityEngine.UI; 5 | 6 | namespace Mga 7 | { 8 | public class CUIShowCardsPanel : MonoBehaviour 9 | { 10 | private List CardsList = new List(); 11 | private List roleInfo = new List(); 12 | public GameObject Obj_ScrollViewContent; 13 | public ScrollRect m_ScrollRect; 14 | public CFixGridRect m_FixGrid; 15 | private bool m_beginDrag = false; 16 | private CLocalCharInfo m_currentDrapChar; 17 | void Awake() 18 | { 19 | for (int i = 0; i < 20; i++) 20 | { 21 | var id = i; 22 | roleInfo.Add(new CLocalCharInfo() { ID = id, Name = "aladdin" }); 23 | } 24 | } 25 | 26 | void Start() 27 | { 28 | while (CardsList.Count > roleInfo.Count) 29 | { 30 | DestroyImmediate(CardsList[0].gameObject); 31 | CardsList.RemoveAt(0); 32 | } 33 | StartCoroutine(createRoleCards()); 34 | 35 | } 36 | 37 | private IEnumerator createRoleCards() 38 | { 39 | List charInfos = new List(); 40 | charInfos.AddRange(roleInfo); 41 | int index = 0; 42 | for (int i = 0; i < charInfos.Count; i++) 43 | { 44 | _createRoleCard(charInfos[i], index++); 45 | if (index % 10 == 0) 46 | yield return null; 47 | } 48 | } 49 | 50 | private void _createRoleCard(CLocalCharInfo roleInfo, int index) 51 | { 52 | CUIPlayedCharCardWidget charCardWidget = null; 53 | if (CardsList.Count > index) 54 | { 55 | charCardWidget = CardsList[index]; 56 | } 57 | else 58 | { 59 | var obj = Instantiate(Resources.Load("Prefab/RoleCard")) as GameObject; 60 | if (obj == null) 61 | { 62 | UnityEngine.Debug.LogError("有误"); 63 | return; 64 | } 65 | obj.name = roleInfo.Name; 66 | 67 | charCardWidget = obj.GetComponent(); 68 | 69 | if (charCardWidget == null) 70 | { 71 | UnityEngine.Debug.LogError("有误"); 72 | return; 73 | } 74 | obj.transform.parent = Obj_ScrollViewContent.transform; 75 | obj.transform.localScale = Vector3.one; 76 | CardsList.Add(charCardWidget); 77 | } 78 | 79 | CUIPlayedCharCardWidget.CUIContent uiContent = new CUIPlayedCharCardWidget.CUIContent(); 80 | uiContent.RoleInfo = roleInfo; 81 | uiContent.ScrollRectObj = m_ScrollRect; 82 | uiContent.FixGridRect = m_FixGrid; 83 | uiContent.BeginDrag = () => 84 | { 85 | m_currentDrapChar = roleInfo; 86 | m_beginDrag = true; 87 | charCardWidget.SetState(false); 88 | }; 89 | uiContent.BeginScroll = () => 90 | { 91 | //CCommonUtility.SetActive(Obj_LeftOverLap, false); 92 | //CCommonUtility.SetActive(Obj_RightOverLap, false); 93 | }; 94 | uiContent.EndDrag = () => 95 | { 96 | m_currentDrapChar = null; 97 | m_beginDrag = false; 98 | charCardWidget.SetState(true); 99 | }; 100 | uiContent.EndScroll = () => 101 | { 102 | //if (!m_canShowOverLap) 103 | // return; 104 | //CCommonUtility.SetActive(Obj_LeftOverLap, m_ScrollRect.horizontalNormalizedPosition > 0.082); 105 | //CCommonUtility.SetActive(Obj_RightOverLap, m_ScrollRect.horizontalNormalizedPosition < 0.98); 106 | }; 107 | charCardWidget.InitContent(uiContent); 108 | } 109 | } 110 | } 111 | -------------------------------------------------------------------------------- /Assets/Scripts/AladdinScript/CUIShowCardsPanel.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bd2b58c746b44a9459256feb5e0dd5d5 3 | timeCreated: 1493101139 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/EasyObjectPool.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 68f26a4aba55aca4fbcb4894ea811c59 3 | folderAsset: yes 4 | timeCreated: 1439395530 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/EasyObjectPool/EasyObjectPool.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Unless otherwise licensed, this file cannot be copied or redistributed in any format without the explicit consent of the author. 3 | * (c) Preet Kamal Singh Minhas, http://marchingbytes.com 4 | * contact@marchingbytes.com 5 | */ 6 | // modified version by Kanglai Qian 7 | using UnityEngine; 8 | using System.Collections.Generic; 9 | 10 | [DisallowMultipleComponent] 11 | [AddComponentMenu("")] 12 | public class PoolObject : MonoBehaviour 13 | { 14 | public string poolName; 15 | //defines whether the object is waiting in pool or is in use 16 | public bool isPooled; 17 | } 18 | 19 | public enum PoolInflationType 20 | { 21 | /// When a dynamic pool inflates, add one to the pool. 22 | INCREMENT, 23 | /// When a dynamic pool inflates, double the size of the pool 24 | DOUBLE 25 | } 26 | 27 | class Pool 28 | { 29 | private Stack availableObjStack = new Stack(); 30 | 31 | //the root obj for unused obj 32 | private GameObject rootObj; 33 | private float lastUsedTime = -1; 34 | private PoolInflationType inflationType; 35 | private string poolName; 36 | private int objectsInUse = 0; 37 | 38 | public Pool(string poolName, GameObject poolObjectPrefab, GameObject rootPoolObj, int initialCount, PoolInflationType type) 39 | { 40 | lastUsedTime = Time.time; 41 | 42 | if (poolObjectPrefab == null) 43 | { 44 | #if UNITY_EDITOR 45 | Debug.LogError("[ObjPoolManager] null pool object prefab !"); 46 | #endif 47 | return; 48 | } 49 | this.poolName = poolName; 50 | this.inflationType = type; 51 | this.rootObj = new GameObject(poolName + "Pool"); 52 | this.rootObj.transform.SetParent(rootPoolObj.transform, false); 53 | 54 | // In case the origin one is Destroyed, we should keep at least one 55 | GameObject go = GameObject.Instantiate(poolObjectPrefab); 56 | PoolObject po = go.GetComponent(); 57 | if (po == null) 58 | { 59 | po = go.AddComponent(); 60 | } 61 | po.poolName = poolName; 62 | AddObjectToPool(po); 63 | 64 | //populate the pool 65 | populatePool(Mathf.Max(initialCount, 1)); 66 | } 67 | 68 | //o(1) 69 | private void AddObjectToPool(PoolObject po) 70 | { 71 | //add to pool 72 | po.gameObject.SetActive(false); 73 | po.gameObject.name = poolName; 74 | availableObjStack.Push(po); 75 | po.isPooled = true; 76 | //add to a root obj 77 | po.gameObject.transform.SetParent(rootObj.transform, false); 78 | } 79 | 80 | private void populatePool(int initialCount) 81 | { 82 | for (int index = 0; index < initialCount; index++) 83 | { 84 | PoolObject po = GameObject.Instantiate(availableObjStack.Peek()); 85 | AddObjectToPool(po); 86 | } 87 | } 88 | 89 | //o(1) 90 | public GameObject NextAvailableObject(bool autoActive) 91 | { 92 | lastUsedTime = Time.time; 93 | 94 | PoolObject po = null; 95 | if (availableObjStack.Count > 1) 96 | { 97 | po = availableObjStack.Pop(); 98 | } 99 | else 100 | { 101 | int increaseSize = 0; 102 | //increment size var, this is for info purpose only 103 | if (inflationType == PoolInflationType.INCREMENT) 104 | { 105 | increaseSize = 1; 106 | } 107 | else if (inflationType == PoolInflationType.DOUBLE) 108 | { 109 | increaseSize = availableObjStack.Count + Mathf.Max(objectsInUse, 0); 110 | } 111 | #if UNITY_EDITOR 112 | Debug.Log(string.Format("Growing pool {0}: {1} populated", poolName, increaseSize)); 113 | #endif 114 | if (increaseSize > 0) 115 | { 116 | populatePool(increaseSize); 117 | po = availableObjStack.Pop(); 118 | } 119 | } 120 | 121 | GameObject result = null; 122 | if (po != null) 123 | { 124 | objectsInUse++; 125 | po.isPooled = false; 126 | result = po.gameObject; 127 | if (autoActive) 128 | { 129 | result.SetActive(true); 130 | } 131 | } 132 | 133 | return result; 134 | } 135 | 136 | //o(1) 137 | public void ReturnObjectToPool(PoolObject po) 138 | { 139 | if (poolName.Equals(po.poolName)) 140 | { 141 | objectsInUse--; 142 | /* we could have used availableObjStack.Contains(po) to check if this object is in pool. 143 | * While that would have been more robust, it would have made this method O(n) 144 | */ 145 | if (po.isPooled) 146 | { 147 | #if UNITY_EDITOR 148 | Debug.LogWarning(po.gameObject.name + " is already in pool. Why are you trying to return it again? Check usage."); 149 | #endif 150 | } 151 | else 152 | { 153 | AddObjectToPool(po); 154 | } 155 | } 156 | else 157 | { 158 | Debug.LogError(string.Format("Trying to add object to incorrect pool {0} {1}", po.poolName, poolName)); 159 | } 160 | } 161 | } -------------------------------------------------------------------------------- /Assets/Scripts/EasyObjectPool/EasyObjectPool.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 25ed55ef4750fc64a8d2879276865942 3 | timeCreated: 1439395530 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/Scripts/EasyObjectPool/PoolObject.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Unless otherwise licensed, this file cannot be copied or redistributed in any format without the explicit consent of the author. 3 | * (c) Preet Kamal Singh Minhas, http://marchingbytes.com 4 | * contact@marchingbytes.com 5 | */ 6 | using UnityEngine; 7 | using System.Collections; 8 | 9 | namespace MarchingBytes { 10 | public class PoolObject : MonoBehaviour { 11 | public string poolName; 12 | //defines whether the object is waiting in pool or is in use 13 | public bool isPooled; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Assets/Scripts/EasyObjectPool/PoolObject.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 189b4f09fe854c44ebb9af19483d2a39 3 | timeCreated: 1439395530 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/Scripts/EasyObjectPool/ResourceManager.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | [DisallowMultipleComponent] 6 | [AddComponentMenu("")] 7 | public class ResourceManager : MonoBehaviour 8 | { 9 | //obj pool 10 | private Dictionary poolDict = new Dictionary(); 11 | 12 | private static ResourceManager mInstance = null; 13 | 14 | public static ResourceManager Instance 15 | { 16 | get 17 | { 18 | if (mInstance == null) 19 | { 20 | GameObject GO = new GameObject("ResourceManager", typeof(ResourceManager)); 21 | // Kanglai: if we have `GO.hideFlags |= HideFlags.DontSave;`, we will encounter Destroy problem when exit playing 22 | // However we should keep using this in Play mode only! 23 | mInstance = GO.GetComponent(); 24 | if (Application.isPlaying) 25 | { 26 | DontDestroyOnLoad(mInstance.gameObject); 27 | } 28 | else 29 | { 30 | Debug.LogWarning("[ResourceManager] You'd better ignore ResourceManager in Editor mode"); 31 | } 32 | } 33 | 34 | return mInstance; 35 | } 36 | } 37 | public void InitPool(string poolName, int size, PoolInflationType type = PoolInflationType.DOUBLE) 38 | { 39 | if (poolDict.ContainsKey(poolName)) 40 | { 41 | return; 42 | } 43 | else 44 | { 45 | GameObject pb = Resources.Load(poolName); 46 | if (pb == null) 47 | { 48 | Debug.LogError("[ResourceManager] Invalide prefab name for pooling :" + poolName); 49 | return; 50 | } 51 | poolDict[poolName] = new Pool(poolName, pb, gameObject, size, type); 52 | } 53 | } 54 | 55 | /// 56 | /// Returns an available object from the pool 57 | /// OR null in case the pool does not have any object available & can grow size is false. 58 | /// 59 | /// 60 | /// 61 | public GameObject GetObjectFromPool(string poolName, bool autoActive = true, int autoCreate = 0) 62 | { 63 | GameObject result = null; 64 | 65 | if (!poolDict.ContainsKey(poolName) && autoCreate > 0) 66 | { 67 | InitPool(poolName, autoCreate, PoolInflationType.INCREMENT); 68 | } 69 | 70 | if (poolDict.ContainsKey(poolName)) 71 | { 72 | Pool pool = poolDict[poolName]; 73 | result = pool.NextAvailableObject(autoActive); 74 | //scenario when no available object is found in pool 75 | #if UNITY_EDITOR 76 | if (result == null) 77 | { 78 | Debug.LogWarning("[ResourceManager]:No object available in " + poolName); 79 | } 80 | #endif 81 | } 82 | #if UNITY_EDITOR 83 | else 84 | { 85 | Debug.LogError("[ResourceManager]:Invalid pool name specified: " + poolName); 86 | } 87 | #endif 88 | return result; 89 | } 90 | 91 | /// 92 | /// Return obj to the pool 93 | /// 94 | /// 95 | public void ReturnObjectToPool(GameObject go) 96 | { 97 | PoolObject po = go.GetComponent(); 98 | if (po == null) 99 | { 100 | #if UNITY_EDITOR 101 | Debug.LogWarning("Specified object is not a pooled instance: " + go.name); 102 | #endif 103 | } 104 | else 105 | { 106 | Pool pool = null; 107 | if (poolDict.TryGetValue(po.poolName, out pool)) 108 | { 109 | pool.ReturnObjectToPool(po); 110 | } 111 | #if UNITY_EDITOR 112 | else 113 | { 114 | Debug.LogWarning("No pool available with name: " + po.poolName); 115 | } 116 | #endif 117 | } 118 | } 119 | 120 | /// 121 | /// Return obj to the pool 122 | /// 123 | /// 124 | public void ReturnTransformToPool(Transform t) 125 | { 126 | if (t == null) 127 | { 128 | #if UNITY_EDITOR 129 | Debug.LogError("[ResourceManager] try to return a null transform to pool!"); 130 | #endif 131 | return; 132 | } 133 | //set gameobject active flase to avoid a onEnable call when set parent 134 | t.gameObject.SetActive(false); 135 | t.SetParent(null, false); 136 | ReturnObjectToPool(t.gameObject); 137 | } 138 | } -------------------------------------------------------------------------------- /Assets/Scripts/EasyObjectPool/ResourceManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4ae24a45f17beae49b3281944f847870 3 | timeCreated: 1476411289 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/Scripts/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b10ceda9bec25b14ea5e190eb9bb0341 3 | folderAsset: yes 4 | timeCreated: 1476279504 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor/LoopScrollRectInspector.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEngine.UI; 3 | using UnityEditor; 4 | 5 | [CustomEditor(typeof(LoopScrollRect), true)] 6 | public class LoopScrollRectInspector : Editor 7 | { 8 | public override void OnInspectorGUI () 9 | { 10 | base.OnInspectorGUI(); 11 | EditorGUILayout.Space(); 12 | 13 | LoopScrollRect scroll = (LoopScrollRect)target; 14 | EditorGUILayout.BeginHorizontal(); 15 | if(GUILayout.Button("Clear")) 16 | { 17 | scroll.ClearCells(); 18 | } 19 | if(GUILayout.Button("Refill")) 20 | { 21 | scroll.RefillCells(); 22 | } 23 | if (GUILayout.Button("Refresh")) 24 | { 25 | scroll.RefreshCells(); 26 | } 27 | EditorGUILayout.EndHorizontal(); 28 | } 29 | } -------------------------------------------------------------------------------- /Assets/Scripts/Editor/LoopScrollRectInspector.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 216d44a40b90b944db6c5f4624768e58 3 | timeCreated: 1439395663 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/Scripts/Editor/SGDefaultControls.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections.Generic; 3 | 4 | namespace UnityEngine.UI 5 | { 6 | public static class SGDefaultControls 7 | { 8 | #region code from DefaultControls.cs 9 | public struct Resources 10 | { 11 | public Sprite standard; 12 | public Sprite background; 13 | public Sprite inputField; 14 | public Sprite knob; 15 | public Sprite checkmark; 16 | public Sprite dropdown; 17 | public Sprite mask; 18 | } 19 | 20 | private const float kWidth = 160f; 21 | private const float kThickHeight = 30f; 22 | private const float kThinHeight = 20f; 23 | //private static Vector2 s_ThickElementSize = new Vector2(kWidth, kThickHeight); 24 | //private static Vector2 s_ThinElementSize = new Vector2(kWidth, kThinHeight); 25 | //private static Vector2 s_ImageElementSize = new Vector2(100f, 100f); 26 | //private static Color s_DefaultSelectableColor = new Color(1f, 1f, 1f, 1f); 27 | //private static Color s_PanelColor = new Color(1f, 1f, 1f, 0.392f); 28 | private static Color s_TextColor = new Color(50f / 255f, 50f / 255f, 50f / 255f, 1f); 29 | 30 | // Helper methods at top 31 | 32 | private static GameObject CreateUIElementRoot(string name, Vector2 size) 33 | { 34 | GameObject child = new GameObject(name); 35 | RectTransform rectTransform = child.AddComponent(); 36 | rectTransform.sizeDelta = size; 37 | return child; 38 | } 39 | 40 | static GameObject CreateUIObject(string name, GameObject parent) 41 | { 42 | GameObject go = new GameObject(name); 43 | go.AddComponent(); 44 | SetParentAndAlign(go, parent); 45 | return go; 46 | } 47 | 48 | private static void SetDefaultTextValues(Text lbl) 49 | { 50 | // Set text values we want across UI elements in default controls. 51 | // Don't set values which are the same as the default values for the Text component, 52 | // since there's no point in that, and it's good to keep them as consistent as possible. 53 | lbl.color = s_TextColor; 54 | } 55 | 56 | private static void SetDefaultColorTransitionValues(Selectable slider) 57 | { 58 | ColorBlock colors = slider.colors; 59 | colors.highlightedColor = new Color(0.882f, 0.882f, 0.882f); 60 | colors.pressedColor = new Color(0.698f, 0.698f, 0.698f); 61 | colors.disabledColor = new Color(0.521f, 0.521f, 0.521f); 62 | } 63 | 64 | private static void SetParentAndAlign(GameObject child, GameObject parent) 65 | { 66 | if (parent == null) 67 | return; 68 | 69 | child.transform.SetParent(parent.transform, false); 70 | SetLayerRecursively(child, parent.layer); 71 | } 72 | 73 | private static void SetLayerRecursively(GameObject go, int layer) 74 | { 75 | go.layer = layer; 76 | Transform t = go.transform; 77 | for (int i = 0; i < t.childCount; i++) 78 | SetLayerRecursively(t.GetChild(i).gameObject, layer); 79 | } 80 | #endregion 81 | 82 | public static GameObject CreateLoopHorizontalScrollRect(DefaultControls.Resources resources) 83 | { 84 | GameObject root = CreateUIElementRoot("Loop Horizontal Scroll Rect", new Vector2(200, 200)); 85 | 86 | GameObject content = CreateUIObject("Content", root); 87 | 88 | RectTransform contentRT = content.GetComponent(); 89 | contentRT.anchorMin = new Vector2(0, 0.5f); 90 | contentRT.anchorMax = new Vector2(0, 0.5f); 91 | contentRT.sizeDelta = new Vector2(0, 200); 92 | contentRT.pivot = new Vector2(0, 0.5f); 93 | 94 | // Setup UI components. 95 | 96 | LoopHorizontalScrollRect scrollRect = root.AddComponent(); 97 | scrollRect.content = contentRT; 98 | scrollRect.viewport = null; 99 | scrollRect.horizontalScrollbar = null; 100 | scrollRect.verticalScrollbar = null; 101 | scrollRect.horizontal = true; 102 | scrollRect.vertical = false; 103 | scrollRect.horizontalScrollbarVisibility = LoopScrollRect.ScrollbarVisibility.Permanent; 104 | scrollRect.verticalScrollbarVisibility = LoopScrollRect.ScrollbarVisibility.Permanent; 105 | scrollRect.horizontalScrollbarSpacing = 0; 106 | scrollRect.verticalScrollbarSpacing = 0; 107 | 108 | root.AddComponent(); 109 | 110 | HorizontalLayoutGroup layoutGroup = content.AddComponent(); 111 | layoutGroup.childAlignment = TextAnchor.MiddleLeft; 112 | layoutGroup.childForceExpandWidth = false; 113 | layoutGroup.childForceExpandHeight = true; 114 | 115 | ContentSizeFitter sizeFitter = content.AddComponent(); 116 | sizeFitter.horizontalFit = ContentSizeFitter.FitMode.PreferredSize; 117 | sizeFitter.verticalFit = ContentSizeFitter.FitMode.Unconstrained; 118 | 119 | return root; 120 | } 121 | 122 | public static GameObject CreateLoopVerticalScrollRect(DefaultControls.Resources resources) 123 | { 124 | GameObject root = CreateUIElementRoot("Loop Vertical Scroll Rect", new Vector2(200, 200)); 125 | 126 | GameObject content = CreateUIObject("Content", root); 127 | 128 | RectTransform contentRT = content.GetComponent(); 129 | contentRT.anchorMin = new Vector2(0.5f, 1); 130 | contentRT.anchorMax = new Vector2(0.5f, 1); 131 | contentRT.sizeDelta = new Vector2(200, 0); 132 | contentRT.pivot = new Vector2(0.5f, 1); 133 | 134 | // Setup UI components. 135 | 136 | LoopVerticalScrollRect scrollRect = root.AddComponent(); 137 | scrollRect.content = contentRT; 138 | scrollRect.viewport = null; 139 | scrollRect.horizontalScrollbar = null; 140 | scrollRect.verticalScrollbar = null; 141 | scrollRect.horizontal = false; 142 | scrollRect.vertical = true; 143 | scrollRect.horizontalScrollbarVisibility = LoopScrollRect.ScrollbarVisibility.Permanent; 144 | scrollRect.verticalScrollbarVisibility = LoopScrollRect.ScrollbarVisibility.Permanent; 145 | scrollRect.horizontalScrollbarSpacing = 0; 146 | scrollRect.verticalScrollbarSpacing = 0; 147 | 148 | root.AddComponent(); 149 | 150 | VerticalLayoutGroup layoutGroup = content.AddComponent(); 151 | layoutGroup.childAlignment = TextAnchor.UpperCenter; 152 | layoutGroup.childForceExpandWidth = true; 153 | layoutGroup.childForceExpandHeight = false; 154 | 155 | ContentSizeFitter sizeFitter = content.AddComponent(); 156 | sizeFitter.horizontalFit = ContentSizeFitter.FitMode.Unconstrained; 157 | sizeFitter.verticalFit = ContentSizeFitter.FitMode.PreferredSize; 158 | 159 | return root; 160 | } 161 | } 162 | } 163 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor/SGDefaultControls.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9e2cfa47387224a4eb069fc6dc8ac8b3 3 | timeCreated: 1476279563 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/Scripts/Editor/SGMenuOptions.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEngine.EventSystems; 3 | using UnityEngine.UI; 4 | 5 | namespace UnityEditor.UI 6 | { 7 | static internal class SGMenuOptions 8 | { 9 | #region code from MenuOptions.cs 10 | private const string kUILayerName = "UI"; 11 | 12 | private const string kStandardSpritePath = "UI/Skin/UISprite.psd"; 13 | private const string kBackgroundSpritePath = "UI/Skin/Background.psd"; 14 | private const string kInputFieldBackgroundPath = "UI/Skin/InputFieldBackground.psd"; 15 | private const string kKnobPath = "UI/Skin/Knob.psd"; 16 | private const string kCheckmarkPath = "UI/Skin/Checkmark.psd"; 17 | private const string kDropdownArrowPath = "UI/Skin/DropdownArrow.psd"; 18 | private const string kMaskPath = "UI/Skin/UIMask.psd"; 19 | 20 | static private DefaultControls.Resources s_StandardResources; 21 | 22 | static private DefaultControls.Resources GetStandardResources() 23 | { 24 | if (s_StandardResources.standard == null) 25 | { 26 | s_StandardResources.standard = AssetDatabase.GetBuiltinExtraResource(kStandardSpritePath); 27 | s_StandardResources.background = AssetDatabase.GetBuiltinExtraResource(kBackgroundSpritePath); 28 | s_StandardResources.inputField = AssetDatabase.GetBuiltinExtraResource(kInputFieldBackgroundPath); 29 | s_StandardResources.knob = AssetDatabase.GetBuiltinExtraResource(kKnobPath); 30 | s_StandardResources.checkmark = AssetDatabase.GetBuiltinExtraResource(kCheckmarkPath); 31 | s_StandardResources.dropdown = AssetDatabase.GetBuiltinExtraResource(kDropdownArrowPath); 32 | s_StandardResources.mask = AssetDatabase.GetBuiltinExtraResource(kMaskPath); 33 | } 34 | return s_StandardResources; 35 | } 36 | 37 | private static void SetPositionVisibleinSceneView(RectTransform canvasRTransform, RectTransform itemTransform) 38 | { 39 | // Find the best scene view 40 | SceneView sceneView = SceneView.lastActiveSceneView; 41 | if (sceneView == null && SceneView.sceneViews.Count > 0) 42 | sceneView = SceneView.sceneViews[0] as SceneView; 43 | 44 | // Couldn't find a SceneView. Don't set position. 45 | if (sceneView == null || sceneView.camera == null) 46 | return; 47 | 48 | // Create world space Plane from canvas position. 49 | Vector2 localPlanePosition; 50 | Camera camera = sceneView.camera; 51 | Vector3 position = Vector3.zero; 52 | if (RectTransformUtility.ScreenPointToLocalPointInRectangle(canvasRTransform, new Vector2(camera.pixelWidth / 2, camera.pixelHeight / 2), camera, out localPlanePosition)) 53 | { 54 | // Adjust for canvas pivot 55 | localPlanePosition.x = localPlanePosition.x + canvasRTransform.sizeDelta.x * canvasRTransform.pivot.x; 56 | localPlanePosition.y = localPlanePosition.y + canvasRTransform.sizeDelta.y * canvasRTransform.pivot.y; 57 | 58 | localPlanePosition.x = Mathf.Clamp(localPlanePosition.x, 0, canvasRTransform.sizeDelta.x); 59 | localPlanePosition.y = Mathf.Clamp(localPlanePosition.y, 0, canvasRTransform.sizeDelta.y); 60 | 61 | // Adjust for anchoring 62 | position.x = localPlanePosition.x - canvasRTransform.sizeDelta.x * itemTransform.anchorMin.x; 63 | position.y = localPlanePosition.y - canvasRTransform.sizeDelta.y * itemTransform.anchorMin.y; 64 | 65 | Vector3 minLocalPosition; 66 | minLocalPosition.x = canvasRTransform.sizeDelta.x * (0 - canvasRTransform.pivot.x) + itemTransform.sizeDelta.x * itemTransform.pivot.x; 67 | minLocalPosition.y = canvasRTransform.sizeDelta.y * (0 - canvasRTransform.pivot.y) + itemTransform.sizeDelta.y * itemTransform.pivot.y; 68 | 69 | Vector3 maxLocalPosition; 70 | maxLocalPosition.x = canvasRTransform.sizeDelta.x * (1 - canvasRTransform.pivot.x) - itemTransform.sizeDelta.x * itemTransform.pivot.x; 71 | maxLocalPosition.y = canvasRTransform.sizeDelta.y * (1 - canvasRTransform.pivot.y) - itemTransform.sizeDelta.y * itemTransform.pivot.y; 72 | 73 | position.x = Mathf.Clamp(position.x, minLocalPosition.x, maxLocalPosition.x); 74 | position.y = Mathf.Clamp(position.y, minLocalPosition.y, maxLocalPosition.y); 75 | } 76 | 77 | itemTransform.anchoredPosition = position; 78 | itemTransform.localRotation = Quaternion.identity; 79 | itemTransform.localScale = Vector3.one; 80 | } 81 | 82 | private static void PlaceUIElementRoot(GameObject element, MenuCommand menuCommand) 83 | { 84 | GameObject parent = menuCommand.context as GameObject; 85 | if (parent == null || parent.GetComponentInParent() == null) 86 | { 87 | parent = GetOrCreateCanvasGameObject(); 88 | } 89 | 90 | string uniqueName = GameObjectUtility.GetUniqueNameForSibling(parent.transform, element.name); 91 | element.name = uniqueName; 92 | Undo.RegisterCreatedObjectUndo(element, "Create " + element.name); 93 | Undo.SetTransformParent(element.transform, parent.transform, "Parent " + element.name); 94 | GameObjectUtility.SetParentAndAlign(element, parent); 95 | if (parent != menuCommand.context) // not a context click, so center in sceneview 96 | SetPositionVisibleinSceneView(parent.GetComponent(), element.GetComponent()); 97 | 98 | Selection.activeGameObject = element; 99 | } 100 | 101 | static public GameObject CreateNewUI() 102 | { 103 | // Root for the UI 104 | var root = new GameObject("Canvas"); 105 | root.layer = LayerMask.NameToLayer(kUILayerName); 106 | Canvas canvas = root.AddComponent(); 107 | canvas.renderMode = RenderMode.ScreenSpaceOverlay; 108 | root.AddComponent(); 109 | root.AddComponent(); 110 | Undo.RegisterCreatedObjectUndo(root, "Create " + root.name); 111 | 112 | // if there is no event system add one... 113 | // CreateEventSystem(false); 114 | return root; 115 | } 116 | 117 | // Helper function that returns a Canvas GameObject; preferably a parent of the selection, or other existing Canvas. 118 | static public GameObject GetOrCreateCanvasGameObject() 119 | { 120 | GameObject selectedGo = Selection.activeGameObject; 121 | 122 | // Try to find a gameobject that is the selected GO or one if its parents. 123 | Canvas canvas = (selectedGo != null) ? selectedGo.GetComponentInParent() : null; 124 | if (canvas != null && canvas.gameObject.activeInHierarchy) 125 | return canvas.gameObject; 126 | 127 | // No canvas in selection or its parents? Then use just any canvas.. 128 | canvas = Object.FindObjectOfType(typeof(Canvas)) as Canvas; 129 | if (canvas != null && canvas.gameObject.activeInHierarchy) 130 | return canvas.gameObject; 131 | 132 | // No canvas in the scene at all? Then create a new one. 133 | return SGMenuOptions.CreateNewUI(); 134 | } 135 | #endregion 136 | 137 | [MenuItem("GameObject/UI/Loop Horizontal Scroll Rect", false, 2151)] 138 | static public void AddLoopHorizontalScrollRect(MenuCommand menuCommand) 139 | { 140 | GameObject go = SGDefaultControls.CreateLoopHorizontalScrollRect(GetStandardResources()); 141 | PlaceUIElementRoot(go, menuCommand); 142 | } 143 | 144 | [MenuItem("GameObject/UI/Loop Vertical Scroll Rect", false, 2152)] 145 | static public void AddLoopVerticalScrollRect(MenuCommand menuCommand) 146 | { 147 | GameObject go = SGDefaultControls.CreateLoopVerticalScrollRect(GetStandardResources()); 148 | PlaceUIElementRoot(go, menuCommand); 149 | } 150 | } 151 | } -------------------------------------------------------------------------------- /Assets/Scripts/Editor/SGMenuOptions.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c4b63bf28f5af0e42a464ac316fef603 3 | timeCreated: 1476279563 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/Scripts/EnhanceScrollView.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9845f99ef8c3dd44c83a77cdb026ee83 3 | folderAsset: yes 4 | timeCreated: 1493966615 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/EnhanceScrollView/CDragOnCard.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEngine.EventSystems; 3 | using UnityEngine.UI; 4 | 5 | public enum DragPosition 6 | { 7 | Left, 8 | Right, 9 | Up, 10 | Down, 11 | } 12 | 13 | [RequireComponent(typeof(Image))] 14 | public class CDragOnCard : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndDragHandler 15 | { 16 | public bool dragOnSurfaces = true; 17 | public ScrollRect m_ScrollRect = null; 18 | public CFixGridRect m_FixGridRect = null; 19 | private RectTransform m_DraggingPlane; 20 | 21 | public bool isVertical = false; 22 | private bool isSelf = false; 23 | private DragPosition m_dragPosition = DragPosition.Left; 24 | 25 | public System.Action DragCallBack = null; 26 | 27 | public void OnBeginDrag(PointerEventData eventData) 28 | { 29 | Vector2 touchDeltaPosition = Vector2.zero; 30 | #if UNITY_EDITOR 31 | float delta_x = Input.GetAxis("Mouse X"); 32 | float delta_y = Input.GetAxis("Mouse Y"); 33 | touchDeltaPosition = new Vector2(delta_x, delta_y); 34 | 35 | #elif UNITY_ANDROID || UNITY_IPHONE 36 | touchDeltaPosition = Input.GetTouch(0).deltaPosition; 37 | #endif 38 | if (isVertical) 39 | { 40 | if(touchDeltaPosition.y > 0) 41 | { 42 | UnityEngine.Debug.Log("上拖"); 43 | m_dragPosition = DragPosition.Up; 44 | } 45 | else 46 | { 47 | UnityEngine.Debug.Log("下拖"); 48 | m_dragPosition = DragPosition.Down; 49 | } 50 | 51 | if (Mathf.Abs(touchDeltaPosition.x) > Mathf.Abs(touchDeltaPosition.y)) 52 | { 53 | isSelf = true; 54 | var canvas = FindInParents(gameObject); 55 | if (canvas == null) 56 | return; 57 | 58 | if (dragOnSurfaces) 59 | m_DraggingPlane = transform as RectTransform; 60 | else 61 | m_DraggingPlane = canvas.transform as RectTransform; 62 | 63 | } 64 | else 65 | { 66 | isSelf = false; 67 | if (m_ScrollRect != null) 68 | m_ScrollRect.OnBeginDrag(eventData); 69 | } 70 | } 71 | else //水平 72 | { 73 | if (touchDeltaPosition.x > 0) 74 | { 75 | UnityEngine.Debug.Log("右移"); 76 | m_dragPosition = DragPosition.Right; 77 | } 78 | else 79 | { 80 | UnityEngine.Debug.Log("左移"); 81 | m_dragPosition = DragPosition.Left; 82 | } 83 | 84 | if (Mathf.Abs(touchDeltaPosition.x) < Mathf.Abs(touchDeltaPosition.y)) 85 | { 86 | isSelf = true; 87 | var canvas = FindInParents(gameObject); 88 | if (canvas == null) 89 | return; 90 | 91 | if (dragOnSurfaces) 92 | m_DraggingPlane = transform as RectTransform; 93 | else 94 | m_DraggingPlane = canvas.transform as RectTransform; 95 | } 96 | else 97 | { 98 | isSelf = false; 99 | if (m_ScrollRect != null) 100 | m_ScrollRect.OnBeginDrag(eventData); 101 | } 102 | } 103 | } 104 | 105 | public void OnDrag(PointerEventData data) 106 | { 107 | if (isSelf) 108 | { 109 | 110 | } 111 | else 112 | { 113 | if (m_ScrollRect != null) 114 | m_ScrollRect.OnDrag(data); 115 | } 116 | } 117 | 118 | public void OnEndDrag(PointerEventData eventData) 119 | { 120 | if (isSelf) 121 | { 122 | 123 | } 124 | else 125 | { 126 | if (m_ScrollRect != null) 127 | m_ScrollRect.OnEndDrag(eventData); 128 | if (m_FixGridRect != null) 129 | m_FixGridRect.OnEndDrag(eventData); 130 | } 131 | 132 | if (DragCallBack != null) 133 | DragCallBack(m_dragPosition); 134 | } 135 | 136 | static public T FindInParents(GameObject go) where T : Component 137 | { 138 | if (go == null) return null; 139 | var comp = go.GetComponent(); 140 | 141 | if (comp != null) 142 | return comp; 143 | 144 | Transform t = go.transform.parent; 145 | while (t != null && comp == null) 146 | { 147 | comp = t.gameObject.GetComponent(); 148 | t = t.parent; 149 | } 150 | return comp; 151 | } 152 | } 153 | -------------------------------------------------------------------------------- /Assets/Scripts/EnhanceScrollView/CDragOnCard.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 953cebb3b49acf140a7c5cfdb4254dc2 3 | timeCreated: 1494226495 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/EnhanceScrollView/EnhanceItem.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using UnityEngine.UI; 4 | 5 | public class EnhanceItem : MonoBehaviour 6 | { 7 | // 在ScrollViewitem中的索引 8 | // 定位当前的位置和缩放 9 | public int scrollViewItemIndex = 0; 10 | public bool inRightArea = false; 11 | 12 | private Vector3 targetPos = Vector3.one; 13 | private Vector3 targetScale = Vector3.one; 14 | 15 | private Transform mTrs; 16 | private Image mImage; 17 | 18 | private int index = 1; 19 | public void Init(int cardIndex = 1) 20 | { 21 | index = cardIndex; 22 | mTrs = this.transform; 23 | mImage = this.GetComponent(); 24 | //mImage.sprite = Resources.Load(string.Format("Texture/card_bg_big_{0}", cardIndex % 6 + 1)); 25 | mImage.sprite = Resources.Load(string.Format("Texture/card_bg_big_{0}", cardIndex % 6 + 1)); 26 | this.gameObject.GetComponent