diff --git a/Editor/CUIGraphicEditor.cs b/Editor/CUIGraphicEditor.cs index 63bfe58..075c786 100644 --- a/Editor/CUIGraphicEditor.cs +++ b/Editor/CUIGraphicEditor.cs @@ -105,9 +105,9 @@ namespace UnityEngine.UI.Extensions if (GUILayout.Button("Reference CUI component for curves")) { - Undo.RecordObject(script, "Reference Reference CUI"); - Undo.RecordObject(script.RefCurves[0], "Reference Reference CUI"); - Undo.RecordObject(script.RefCurves[1], "Reference Reference CUI"); + Undo.RecordObject(script, "Reference CUI"); + Undo.RecordObject(script.RefCurves[0], "Reference CUI"); + Undo.RecordObject(script.RefCurves[1], "Reference CUI"); EditorUtility.SetDirty(script); script.ReferenceCUIForBCurves(); @@ -115,7 +115,7 @@ namespace UnityEngine.UI.Extensions script.Refresh(); } - EditorGUILayout.HelpBox("Auto set the curves' control points by refencing another CUI. You need to set Ref CUI Graphic (e.g. CUIImage) first.", MessageType.Info); + EditorGUILayout.HelpBox("Auto set the curves' control points by referencing another CUI. You need to set Ref CUI Graphic (e.g. CUIImage) first.", MessageType.Info); EditorGUI.EndDisabledGroup(); } diff --git a/Editor/CanvasGroupActivator.cs b/Editor/CanvasGroupActivator.cs index 37677b8..5730bb6 100644 --- a/Editor/CanvasGroupActivator.cs +++ b/Editor/CanvasGroupActivator.cs @@ -1,7 +1,7 @@ /// Credit dakka /// Sourced from - http://forum.unity3d.com/threads/scripts-useful-4-6-scripts-collection.264161/#post-1752415 /// Notes - Mod from Yilmaz Kiymaz's editor scripts presentation at Unite 2013 -/// Updated ddreaper - removed Linq use, not required. +/// Updated simonDarksideJ - removed Linq use, not required. using UnityEditor; @@ -61,7 +61,7 @@ namespace UnityEngine.UI.Extensions canvasGroups[i].interactable = false; canvasGroups[i].blocksRaycasts = false; } - //If activated and initially deactive + //If activated and initially deactivate else if (active && !initialActive) { //Deactivate all others and activate this diff --git a/Editor/FancyScrollView/ScrollerEditor.cs b/Editor/FancyScrollView/ScrollerEditor.cs index 66ce944..2d4982f 100644 --- a/Editor/FancyScrollView/ScrollerEditor.cs +++ b/Editor/FancyScrollView/ScrollerEditor.cs @@ -4,7 +4,7 @@ using UnityEditor; using UnityEditor.AnimatedValues; -// For manteinance, every new [SerializeField] variable in Scroller must be declared here +// For maintenance, every new [SerializeField] variable in Scroller must be declared here namespace UnityEngine.UI.Extensions { diff --git a/Editor/ScrollPositionControllerEditor.cs b/Editor/ScrollPositionControllerEditor.cs index 30d7150..e4ae2cc 100644 --- a/Editor/ScrollPositionControllerEditor.cs +++ b/Editor/ScrollPositionControllerEditor.cs @@ -1,7 +1,7 @@ /// Credit setchi (https://github.com/setchi) /// Sourced from - https://github.com/setchi/FancyScrollView -// For manteinance, every new [SerializeField] variable in ScrollPositionController must be declared here +// For maintenance, every new [SerializeField] variable in ScrollPositionController must be declared here using UnityEditor; diff --git a/Editor/UIExtensionsMenuOptions.cs b/Editor/UIExtensionsMenuOptions.cs index 027bf87..2915619 100644 --- a/Editor/UIExtensionsMenuOptions.cs +++ b/Editor/UIExtensionsMenuOptions.cs @@ -710,7 +710,7 @@ namespace UnityEditor.UI } #endregion - #region Accordian + #region Accordion [MenuItem("GameObject/UI/Extensions/Accordion/Accordion Group", false)] static public void AddAccordionGroup(MenuCommand menuCommand) { diff --git a/Examples b/Examples index 4878f8d..8f7a9de 160000 --- a/Examples +++ b/Examples @@ -1 +1 @@ -Subproject commit 4878f8d7d74c72a334b6204dffc9cb117a9463f2 +Subproject commit 8f7a9de774bcf64109a5e1362650e9f37572588f diff --git a/README.md b/README.md index fca00a4..215a50c 100644 --- a/README.md +++ b/README.md @@ -23,17 +23,17 @@ In this repository is a collection of extension scripts / effects and controls t You can either download / fork this project to access the scripts, or you can also download these pre-compiled Unity Assets, chock full of goodness for each release: -# [Download](https://bitbucket.org/UnityUIExtensions/unity-ui-extensions/wiki/Downloads) - 2019.1 (aka 2.1) +# [Download - 2019.4 (aka 2.2)](https://bitbucket.org/UnityUIExtensions/unity-ui-extensions/wiki/Downloads) We have expanded where you can download the UnityPackage asset and widened the options to contribute to the project. -> I will still stress however, ***contribution is optional***. **The asset / code will always remain FREE** +> I will still stress however, ***contribution is optional***. **The assets / code will always remain FREE** | [](https://unityuiextensions.itch.io/uiextensions2-0 "Download from Itch.IO") | [](https://unionassets.com/unity-ui-extensions "Download from Union Assets") | [](https://www.patreon.com/UnityUIExtensions "Support Unity UI Extensions on Patreon & download")| | :--- | :--- | :--- | | [Grab from Itchio](https://unityuiextensions.itch.io/uiextensions2-0) | [Obtain via Union Assets](https://unionassets.com/unity-ui-extensions) |[Support through Patreon](https://www.patreon.com/UnityUIExtensions) | -> Still available on the [BitBucket site](https://bitbucket.org/UnityUIExtensions/unity-ui-extensions/downloads/UnityUIExtensions-2019-1.unitypackage) if you prefer +> Still available to download on the [BitBucket site](https://bitbucket.org/UnityUIExtensions/unity-ui-extensions/downloads) if you prefer To view previous releases, visit the [release archive](https://bitbucket.org/UnityUIExtensions/unity-ui-extensions/wiki/Downloads) @@ -43,7 +43,7 @@ To view previous releases, visit the [release archive](https://bitbucket.org/Uni If you wish to further support the Unity UI Extensions project itself, then you can either subsidise your downloads above, or using the links below. -All funds go to support the project, no matter the amount. Donations in code are also extremely welcome. +All funds go to support the project, no matter the amount. **Donations in code are also extremely welcome** | | | |---|---| @@ -62,12 +62,11 @@ To get started with the project, here's a little guide: # [Updates:](https://bitbucket.org/UnityUIExtensions/unity-ui-extensions/wiki/ReleaseNotes/RELEASENOTES) -## Update 2019.1 - formally 2.1 - Going with the times +## Release 2019.4 - (v2.2) - Back from the future -Given that it's been a while since the last release and a fair few number of fixes have been introduced since the last update, it's only fair I get this point release out for the masses. -This is only a point release and we are still working hard on the next full update +It's been a long year since the last official release of the Unity UI Extensions project and WOW, have there been a lot of ups and downs. Big thanks to the community for their support of the project whether that was funds, code or even just testing and helping to iron out some pesky bugs. -> Be sure to logon to the new Gitter Chat site for the UI Extensions project, if you have any questions, queries or suggestions +> Be sure to logon to the new [Gitter Chat](https://gitter.im/Unity-UI-Extensions/Lobby) site for the UI Extensions project, if you have any questions, queries or suggestions > > Much easier that posting a question / issue on YouTube, Twitter or Facebook :D > @@ -75,35 +74,42 @@ This is only a point release and we are still working hard on the next full upda ### New / updated features -* Updated and tested with Unity 2018 / 2019 -* FancyScrollView updated with newer version (note breaking change) -* Added test version of a LineRender control using a List instead of an array -* New CardUI layout control, for a snazzy flip card system -* New UI Circle Progress indicator control +* New UPM deployment for Unity 2019, 2018 will still need to use the asset packages due to Unity compatibility issues. +* Updated the project to the new Unity packaging guidelines, including separating out the examples to a separate package. +* Many line drawing updates, including the ability to draw using a mouse (check the examples) +* Scroll Snaps (HSS/VSS) now have a "Hard Swipe" feature to restrict movement to a single page for each swipe +* Scroll Snaps have also been udpated to work better with the UIInfiniteScroll control +* New Uniy Card UI controls thanks to @RyanslikeSoCool +* Update to the Fancy Scoll controls with even more added fanciness +* Several updates to adopt newer Unity standards in the controls to ensure full forwards and backwards compatibility ### Examples / Examples / Examples -(All examples can be deleted without affecting the extensions) +Examples now have their own package, this simplifies their use and deployment. Especially in 2019 with the UPM deployment. -* Added example for CardUI -* Added example for the LineRendererList experiment -* FancyScrollView examples updated to the new version -* Example for new UICircle progress control +* Refreshed all examples for Unity 2019 +* New Card UI Examples to supplement the new controls +* New Infinite Scroll Snap example +* Fancy Scroll view updated with 2 new examples +* New particle system example, demonstrating programmatic control of the particle system ### Fixes -* General clean up of build warnings -* Refactored primitive controls to be cleaner -* Various HSS / VSS updates, mostly from the community -* ScrollConflictManager updated to work better with nested HSS/VSS -* UI Knob resolved to with screen space camera -* Fix for the menu system, which was disabling prefabs instead of the scene instance -* Fixed shader in UIParticle System -* TextPic updated to support culling properly -* Reorderable List updated with additional options -* Screenspace overlay support added to the Tooltip control -* UIParticle system now supports 3D rotation -* UIVerticalScroller updated -* Radial slider updated with +* Mouse position use updated in + - RadialSlider + - ColorSampler + - TiltWindow +* Check compiler warnings (#197) +* Line Renderer click to add lines (#183) +* ScrollSnap Swiping options - hard fast swipe (#176) +* Shader Loading issue / UIParticleSystem (#229) +* Issue where Menu Prefabs would be disabled instead of their Clones (#210) +* Check ScrollSnapBase update (#265) +* UIInfiniteScroller support for VSS updated and fixes +* Fix to allow radial slider to start from positions other than left +* Fix UI Particles: Texture sheet animation + Random row(#256) +* Fix for wandering ScrollSnap controls due to Local Positioning drift +* Divide By Zero fix for Gradient (#58) + ### Known issues No new issues in this release, but check the issues list for things we are currently working on: @@ -111,7 +117,9 @@ No new issues in this release, but check the issues list for things we are curre * [UI Extensions Issue log](https://bitbucket.org/UnityUIExtensions/unity-ui-extensions/issues?status=new&status=open) ## Upgrade Notes -No significant concerns, should be able to update over the 2.1 package. If upgrading prior to 2.1, we still recommend removing the UnityUIExtensions folder and then re-importing +Due to the restructure of the package to meet Unity's new package guidelines, we recomment **Deleting the current Unity UI Extensions** folder prior to importing the new package + +For Unity 2019 users using the new UPM deployment, be sure to delete the existing folder in your assets folder before adding the new package to avoid conflict ---------------- ## Release History @@ -134,10 +142,10 @@ There are almost 70+ extension controls / effect and other utilities in the proj [Controls](https://bitbucket.org/UnityUIExtensions/unity-ui-extensions/wiki/Controls#markdown-header-controls)||||| ------|------|------|------| -Accordion|ColorPicker|SelectionBox|UIFlippable|ComboBox -AutoCompleteComboBox|DropDownList|BoundToolTip|UIWindowBase|UI_Knob -TextPic|InputFocus|Box Slider|CooldownButton|Segmented Control -Stepper|Range Slider||| +Accordion|ColorPicker|Selection Box|UI Flippable|ComboBox +AutoComplete ComboBox|DropDown List|BoundToolTip|UIWindowBase|UI Knob +TextPic|Input Focus|Box Slider|Cooldown Button|Segmented Control +Stepper|Range Slider|Radial Slider|MultiTouch Scroll Rect| |||| [Primitives](https://bitbucket.org/UnityUIExtensions/unity-ui-extensions/wiki/Controls#markdown-header-primitives)||||| @@ -150,14 +158,14 @@ UIPolygon|||| ------|------|------|------| Horizontal Scroll Snap|Vertical Scroll Snap|Flow Layout Group|Radial Layout|Tile Size Fitter Scroll Snap (alt implementation)|Reorderable List|UI Vertical Scroller|Curved Layout|Table Layout -FancyScrollView|||| +FancyScrollView|Card UI|Scroll Position Controller|| |||| [Effects](https://bitbucket.org/UnityUIExtensions/unity-ui-extensions/wiki/Controls#markdown-header-effect_components)||||| ------|------|------|------| Best Fit Outline|Curved Text|Gradient|Gradient2|Letter Spacing NicerOutline|RaycastMask|UIFlippable|UIImageCrop|SoftAlphaMask -CylinderText|UIParticleSystem|CurlyUI|| +CylinderText|UIParticleSystem|CurlyUI|Shine Effect|Shader Effects |||| [VR Components](https://bitbucket.org/UnityUIExtensions/unity-ui-extensions/wiki/Controls#markdown-header-vr_components)||||| @@ -184,21 +192,32 @@ UIHighlightable|Menu Manager|Pagination Manager|| --- -# [How do I get set up? ](https://bitbucket.org/UnityUIExtensions/unity-ui-extensions/wiki/GettingStarted) +# [How do I get set up?](https://bitbucket.org/UnityUIExtensions/unity-ui-extensions/wiki/GettingStarted) +As of Unity 2019, there are now two paths for getting access to the Unity UI Extensions project: + +- Unity 2019 or higher +The recommended way to add the Unity UI Extensions project to your solution is to use the Unity package Manager. Simply use the [Unity Package Manager](https://bitbucket.org/UnityUIExtensions/unity-ui-extensions/wiki/UPMInstallation) to reference the project and install it. + +Alternatively, you can also use the pre-compiled Unity packages if you wish, however, UPM offers full versioning support to allow you to switch versions as you wish. + +- Unity 2018 or lower +The pre-compiled Unity assets are the only solution for Unity 2018 or earlier due to the changes in the Unity UI framework in Unity made for 2019. Either clone / download this repository to your machine and then copy the scripts in, or use the pre-packaged .UnityPackage for your version of Unity and import it as a custom package in to your project. # [Contribution guidelines ](https://bitbucket.org/UnityUIExtensions/unity-ui-extensions/wiki/ContributionGuidelines) Got a script you want added? Then just fork the bitbucket repository and submit a PR. All contributions accepted (including fixes) -Just ensure -* The header of the script matches the standard used in all scripts + +Just ensure: + +* The header of the script should match the standard used in all scripts * The script uses the **Unity.UI.Extensions** namespace so they do not affect any other developments * (optional) Add Component and Editor options where possible (editor options are in the Editor\UIExtensionsMenuOptions.cs file) # [License ](https://bitbucket.org/UnityUIExtensions/unity-ui-extensions/wiki/License) -All scripts conform to the BSD license and are free to use / distribute. See the [LICENSE](https://bitbucket.org/UnityUIExtensions/unity-ui-extensions/wiki/License) file for more information +All scripts conform to the BSD3 license and are free to use / distribute. See the [LICENSE](https://bitbucket.org/UnityUIExtensions/unity-ui-extensions/wiki/License) file for more information # [Like what you see? ](https://bitbucket.org/UnityUIExtensions/unity-ui-extensions/wiki/FurtherInfo) @@ -213,17 +232,4 @@ I will add more sample scenes for the UI examples in this repository and detail # [Previous Releases](https://bitbucket.org/UnityUIExtensions/unity-ui-extensions/wiki/Downloads) -* [Unity UI Extensions Unity 4.x Asset](https://bitbucket.org/UnityUIExtensions/unity-ui-extensions/downloads/UnityUIExtensions-4.x.unitypackage) - -* [Unity UI Extensions Unity 5.1 Asset](https://bitbucket.org/UnityUIExtensions/unity-ui-extensions/downloads/UnityUIExtensions-5.1.unitypackage) - -* [Unity UI Extensions Unity 5.2 Asset](https://bitbucket.org/UnityUIExtensions/unity-ui-extensions/downloads/UnityUIExtensions-5.2.unitypackage) <- 5.2.0 - 5.2.1 base releases ONLY - -* [Unity UI Extensions Unity 5.3 (5.2.1P+) Asset](https://bitbucket.org/UnityUIExtensions/unity-ui-extensions/downloads/UnityUIExtensions-5.3.unitypackage) <- use this for 5.2.1P+ releases - -> **Note** To retain 5.2 compatibility in the 5.3 package, you will see two warnings related to: -> ``` -> `UnityEngine.UI.InputField.onValueChange' is obsolete. -> ``` -> This has no effect on the package working in 5.4 plus and is only there to maintain backwards compatibility. We will look to update/remove this in a future release, likely after 5.4. -If you have any concerns, feel free to update your code in your project to add the missing "d". Unity have ensured it still works as they have mapped the API change for now. \ No newline at end of file +Please see the [full downloads list](https://bitbucket.org/UnityUIExtensions/unity-ui-extensions/wiki/Downloads) for all previous releases and their corresponding download links. \ No newline at end of file diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 17c0334..13482a6 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -2,6 +2,80 @@ This file contains the up to date release notes for each release of the UI Extensions project including release videos where required. ---------------- +## Update 2019.4 - 2.2 - Back from the future + +It's been a long year since the last official release of the Unity UI Extensions project and WOW, have there been a lot of ups and downs. Big thanks to the community for their support of the project whether that was funds, code or even just testing and helping to iron out some pesky bugs. + +> Be sure to logon to the new [Gitter Chat](https://gitter.im/Unity-UI-Extensions/Lobby) site for the UI Extensions project, if you have any questions, queries or suggestions +> +> Much easier that posting a question / issue on YouTube, Twitter or Facebook :D +> +> ## [UIExtensions Gitter Chanel](https://gitter.im/Unity-UI-Extensions/Lobby) + +### New / updated features + +* New UPM deployment for Unity 2019, 2018 will still need to use the asset packages due to Unity compatibility issues. +* Updated the project to the new Unity packaging guidelines, including separating out the examples to a separate package. +* Many line drawing updates, including the ability to draw using a mouse (check the examples) +* Scroll Snaps (HSS/VSS) now have a "Hard Swipe" feature to restrict movement to a single page for each swipe +* Scroll Snaps have also been udpated to work better with the UIInfiniteScroll control +* New Uniy Card UI controls thanks to @RyanslikeSoCool +* Update to the Fancy Scoll controls with even more added fanciness +* Several updates to adopt newer Unity standards in the controls to ensure full forwards and backwards compatibility + +### Examples / Examples / Examples +Examples now have their own package, this simplifies their use and deployment. Especially in 2019 with the UPM deployment. + +* Refreshed all examples for Unity 2019 +* New Card UI Examples to supplement the new controls +* New Infinite Scroll Snap example +* Fancy Scroll view updated with 2 new examples +* New particle system example, demonstrating programmatic control of the particle system + +### Fixes + +* Mouse position use updated in + - RadialSlider + - ColorSampler + - TiltWindow +* Check compiler warnings (#197) +* Line Renderer click to add lines (#183) +* ScrollSnap Swiping options - hard fast swipe (#176) +* Shader Loading issue / UIParticleSystem (#229) +* Issue where Menu Prefabs would be disabled instead of their Clones (#210) +* Check ScrollSnapBase update (#265) +* UIInfiniteScroller support for VSS updated and fixes +* Fix to allow radial slider to start from positions other than left +* Fix UI Particles: Texture sheet animation + Random row(#256) +* Fix for wandering ScrollSnap controls due to Local Positioning drift +* Divide By Zero fix for Gradient (#58) + + +### Known issues +No new issues in this release, but check the issues list for things we are currently working on: + +* [UI Extensions Issue log](https://bitbucket.org/UnityUIExtensions/unity-ui-extensions/issues?status=new&status=open) + +# [Installation Instructions](https://bitbucket.org/UnityUIExtensions/unity-ui-extensions/wiki/GettingStarted) + +As of Unity 2019, there are now two paths for getting access to the Unity UI Extensions project: + +- Unity 2019 or higher +The recommended way to add the Unity UI Extensions project to your solution is to use the Unity package Manager. Simply use the Unity Package Manager to reference the project to install it + +Alternatively, you can also use the pre-compiled Unity packages if you wish, however, UPM offers full versioning support to allow you to switch versions as you wish. + +- Unity 2018 or lower +The pre-compiled Unity assets are the only solution for Unity 2018 or earlier due to the changes in the Unity UI framework in Unity made for 2019. +Either clone / download this repository to your machine and then copy the scripts in, or use the pre-packaged .UnityPackage for your version of Unity and import it as a custom package in to your project. + +## Upgrade Notes +Due to the restructure of the package to meet Unity's new package guidelines, we recommend **Deleting the current Unity UI Extensions** folder prior to importing the new package. + +For Unity 2019 users using the new UPM deployment, be sure to delete the existing folder in your assets folder before adding the new package to avoid conflict. + +--- + ## Update 2019.1 - formally 2.1 - Going with the times Given that it's been a while since the last release and a fair few number of fixes have been introduced since the last update, it's only fair I get this point release out for the masses. diff --git a/Runtime.meta b/Runtime.meta new file mode 100644 index 0000000..2caefaa --- /dev/null +++ b/Runtime.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: dae773db9d022de4b891928437a0c082 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources.meta b/Runtime/Resources.meta similarity index 100% rename from Resources.meta rename to Runtime/Resources.meta diff --git a/Resources/Shaders.meta b/Runtime/Resources/Shaders.meta similarity index 100% rename from Resources/Shaders.meta rename to Runtime/Resources/Shaders.meta diff --git a/Resources/Shaders/SoftMaskShader.shader b/Runtime/Resources/Shaders/SoftMaskShader.shader similarity index 100% rename from Resources/Shaders/SoftMaskShader.shader rename to Runtime/Resources/Shaders/SoftMaskShader.shader diff --git a/Resources/Shaders/SoftMaskShader.shader.meta b/Runtime/Resources/Shaders/SoftMaskShader.shader.meta similarity index 100% rename from Resources/Shaders/SoftMaskShader.shader.meta rename to Runtime/Resources/Shaders/SoftMaskShader.shader.meta diff --git a/Resources/Shaders/UI Particle Add.shader b/Runtime/Resources/Shaders/UI Particle Add.shader similarity index 100% rename from Resources/Shaders/UI Particle Add.shader rename to Runtime/Resources/Shaders/UI Particle Add.shader diff --git a/Resources/Shaders/UI Particle Add.shader.meta b/Runtime/Resources/Shaders/UI Particle Add.shader.meta similarity index 100% rename from Resources/Shaders/UI Particle Add.shader.meta rename to Runtime/Resources/Shaders/UI Particle Add.shader.meta diff --git a/Resources/Shaders/UI Particle AddMultiply.shader b/Runtime/Resources/Shaders/UI Particle AddMultiply.shader similarity index 100% rename from Resources/Shaders/UI Particle AddMultiply.shader rename to Runtime/Resources/Shaders/UI Particle AddMultiply.shader diff --git a/Resources/Shaders/UI Particle AddMultiply.shader.meta b/Runtime/Resources/Shaders/UI Particle AddMultiply.shader.meta similarity index 100% rename from Resources/Shaders/UI Particle AddMultiply.shader.meta rename to Runtime/Resources/Shaders/UI Particle AddMultiply.shader.meta diff --git a/Resources/Shaders/UI Particle AddSmooth.shader b/Runtime/Resources/Shaders/UI Particle AddSmooth.shader similarity index 100% rename from Resources/Shaders/UI Particle AddSmooth.shader rename to Runtime/Resources/Shaders/UI Particle AddSmooth.shader diff --git a/Resources/Shaders/UI Particle AddSmooth.shader.meta b/Runtime/Resources/Shaders/UI Particle AddSmooth.shader.meta similarity index 100% rename from Resources/Shaders/UI Particle AddSmooth.shader.meta rename to Runtime/Resources/Shaders/UI Particle AddSmooth.shader.meta diff --git a/Resources/Shaders/UI Particle Alpha Blend.shader b/Runtime/Resources/Shaders/UI Particle Alpha Blend.shader similarity index 100% rename from Resources/Shaders/UI Particle Alpha Blend.shader rename to Runtime/Resources/Shaders/UI Particle Alpha Blend.shader diff --git a/Resources/Shaders/UI Particle Alpha Blend.shader.meta b/Runtime/Resources/Shaders/UI Particle Alpha Blend.shader.meta similarity index 100% rename from Resources/Shaders/UI Particle Alpha Blend.shader.meta rename to Runtime/Resources/Shaders/UI Particle Alpha Blend.shader.meta diff --git a/Resources/Shaders/UI Particle Blend.shader b/Runtime/Resources/Shaders/UI Particle Blend.shader similarity index 100% rename from Resources/Shaders/UI Particle Blend.shader rename to Runtime/Resources/Shaders/UI Particle Blend.shader diff --git a/Resources/Shaders/UI Particle Blend.shader.meta b/Runtime/Resources/Shaders/UI Particle Blend.shader.meta similarity index 100% rename from Resources/Shaders/UI Particle Blend.shader.meta rename to Runtime/Resources/Shaders/UI Particle Blend.shader.meta diff --git a/Resources/Shaders/UI Particle Multiply.shader b/Runtime/Resources/Shaders/UI Particle Multiply.shader similarity index 100% rename from Resources/Shaders/UI Particle Multiply.shader rename to Runtime/Resources/Shaders/UI Particle Multiply.shader diff --git a/Resources/Shaders/UI Particle Multiply.shader.meta b/Runtime/Resources/Shaders/UI Particle Multiply.shader.meta similarity index 100% rename from Resources/Shaders/UI Particle Multiply.shader.meta rename to Runtime/Resources/Shaders/UI Particle Multiply.shader.meta diff --git a/Resources/Shaders/UI Particle MultiplyDouble.shader b/Runtime/Resources/Shaders/UI Particle MultiplyDouble.shader similarity index 100% rename from Resources/Shaders/UI Particle MultiplyDouble.shader rename to Runtime/Resources/Shaders/UI Particle MultiplyDouble.shader diff --git a/Resources/Shaders/UI Particle MultiplyDouble.shader.meta b/Runtime/Resources/Shaders/UI Particle MultiplyDouble.shader.meta similarity index 100% rename from Resources/Shaders/UI Particle MultiplyDouble.shader.meta rename to Runtime/Resources/Shaders/UI Particle MultiplyDouble.shader.meta diff --git a/Resources/Shaders/UI Particle Premultiply Blend.shader b/Runtime/Resources/Shaders/UI Particle Premultiply Blend.shader similarity index 100% rename from Resources/Shaders/UI Particle Premultiply Blend.shader rename to Runtime/Resources/Shaders/UI Particle Premultiply Blend.shader diff --git a/Resources/Shaders/UI Particle Premultiply Blend.shader.meta b/Runtime/Resources/Shaders/UI Particle Premultiply Blend.shader.meta similarity index 100% rename from Resources/Shaders/UI Particle Premultiply Blend.shader.meta rename to Runtime/Resources/Shaders/UI Particle Premultiply Blend.shader.meta diff --git a/Resources/Shaders/UI Particle VertexLit Blended.shader b/Runtime/Resources/Shaders/UI Particle VertexLit Blended.shader similarity index 100% rename from Resources/Shaders/UI Particle VertexLit Blended.shader rename to Runtime/Resources/Shaders/UI Particle VertexLit Blended.shader diff --git a/Resources/Shaders/UI Particle VertexLit Blended.shader.meta b/Runtime/Resources/Shaders/UI Particle VertexLit Blended.shader.meta similarity index 100% rename from Resources/Shaders/UI Particle VertexLit Blended.shader.meta rename to Runtime/Resources/Shaders/UI Particle VertexLit Blended.shader.meta diff --git a/Resources/Shaders/UIAdditive.shader b/Runtime/Resources/Shaders/UIAdditive.shader similarity index 100% rename from Resources/Shaders/UIAdditive.shader rename to Runtime/Resources/Shaders/UIAdditive.shader diff --git a/Resources/Shaders/UIAdditive.shader.meta b/Runtime/Resources/Shaders/UIAdditive.shader.meta similarity index 100% rename from Resources/Shaders/UIAdditive.shader.meta rename to Runtime/Resources/Shaders/UIAdditive.shader.meta diff --git a/Resources/Shaders/UIImageCrop.shader b/Runtime/Resources/Shaders/UIImageCrop.shader similarity index 100% rename from Resources/Shaders/UIImageCrop.shader rename to Runtime/Resources/Shaders/UIImageCrop.shader diff --git a/Resources/Shaders/UIImageCrop.shader.meta b/Runtime/Resources/Shaders/UIImageCrop.shader.meta similarity index 100% rename from Resources/Shaders/UIImageCrop.shader.meta rename to Runtime/Resources/Shaders/UIImageCrop.shader.meta diff --git a/Resources/Shaders/UILinearDodge.shader b/Runtime/Resources/Shaders/UILinearDodge.shader similarity index 100% rename from Resources/Shaders/UILinearDodge.shader rename to Runtime/Resources/Shaders/UILinearDodge.shader diff --git a/Resources/Shaders/UILinearDodge.shader.meta b/Runtime/Resources/Shaders/UILinearDodge.shader.meta similarity index 100% rename from Resources/Shaders/UILinearDodge.shader.meta rename to Runtime/Resources/Shaders/UILinearDodge.shader.meta diff --git a/Resources/Shaders/UIMultiply.shader b/Runtime/Resources/Shaders/UIMultiply.shader similarity index 100% rename from Resources/Shaders/UIMultiply.shader rename to Runtime/Resources/Shaders/UIMultiply.shader diff --git a/Resources/Shaders/UIMultiply.shader.meta b/Runtime/Resources/Shaders/UIMultiply.shader.meta similarity index 100% rename from Resources/Shaders/UIMultiply.shader.meta rename to Runtime/Resources/Shaders/UIMultiply.shader.meta diff --git a/Resources/Shaders/UIParticleHidden.shader b/Runtime/Resources/Shaders/UIParticleHidden.shader similarity index 100% rename from Resources/Shaders/UIParticleHidden.shader rename to Runtime/Resources/Shaders/UIParticleHidden.shader diff --git a/Resources/Shaders/UIParticleHidden.shader.meta b/Runtime/Resources/Shaders/UIParticleHidden.shader.meta similarity index 100% rename from Resources/Shaders/UIParticleHidden.shader.meta rename to Runtime/Resources/Shaders/UIParticleHidden.shader.meta diff --git a/Resources/Shaders/UIScreen.shader b/Runtime/Resources/Shaders/UIScreen.shader similarity index 100% rename from Resources/Shaders/UIScreen.shader rename to Runtime/Resources/Shaders/UIScreen.shader diff --git a/Resources/Shaders/UIScreen.shader.meta b/Runtime/Resources/Shaders/UIScreen.shader.meta similarity index 100% rename from Resources/Shaders/UIScreen.shader.meta rename to Runtime/Resources/Shaders/UIScreen.shader.meta diff --git a/Resources/Shaders/UISoftAdditive.shader b/Runtime/Resources/Shaders/UISoftAdditive.shader similarity index 100% rename from Resources/Shaders/UISoftAdditive.shader rename to Runtime/Resources/Shaders/UISoftAdditive.shader diff --git a/Resources/Shaders/UISoftAdditive.shader.meta b/Runtime/Resources/Shaders/UISoftAdditive.shader.meta similarity index 100% rename from Resources/Shaders/UISoftAdditive.shader.meta rename to Runtime/Resources/Shaders/UISoftAdditive.shader.meta diff --git a/Scripts.meta b/Runtime/Scripts.meta similarity index 100% rename from Scripts.meta rename to Runtime/Scripts.meta diff --git a/Scripts/Controls.meta b/Runtime/Scripts/Controls.meta similarity index 100% rename from Scripts/Controls.meta rename to Runtime/Scripts/Controls.meta diff --git a/Scripts/Controls/Accordion.meta b/Runtime/Scripts/Controls/Accordion.meta similarity index 100% rename from Scripts/Controls/Accordion.meta rename to Runtime/Scripts/Controls/Accordion.meta diff --git a/Scripts/Controls/Accordion/Accordion.cs b/Runtime/Scripts/Controls/Accordion/Accordion.cs similarity index 100% rename from Scripts/Controls/Accordion/Accordion.cs rename to Runtime/Scripts/Controls/Accordion/Accordion.cs diff --git a/Scripts/Controls/Accordion/Accordion.cs.meta b/Runtime/Scripts/Controls/Accordion/Accordion.cs.meta similarity index 100% rename from Scripts/Controls/Accordion/Accordion.cs.meta rename to Runtime/Scripts/Controls/Accordion/Accordion.cs.meta diff --git a/Scripts/Controls/Accordion/AccordionElement.cs b/Runtime/Scripts/Controls/Accordion/AccordionElement.cs similarity index 100% rename from Scripts/Controls/Accordion/AccordionElement.cs rename to Runtime/Scripts/Controls/Accordion/AccordionElement.cs diff --git a/Scripts/Controls/Accordion/AccordionElement.cs.meta b/Runtime/Scripts/Controls/Accordion/AccordionElement.cs.meta similarity index 100% rename from Scripts/Controls/Accordion/AccordionElement.cs.meta rename to Runtime/Scripts/Controls/Accordion/AccordionElement.cs.meta diff --git a/Scripts/Controls/Accordion/Tweening.meta b/Runtime/Scripts/Controls/Accordion/Tweening.meta similarity index 100% rename from Scripts/Controls/Accordion/Tweening.meta rename to Runtime/Scripts/Controls/Accordion/Tweening.meta diff --git a/Scripts/Controls/Accordion/Tweening/FloatTween.cs b/Runtime/Scripts/Controls/Accordion/Tweening/FloatTween.cs similarity index 100% rename from Scripts/Controls/Accordion/Tweening/FloatTween.cs rename to Runtime/Scripts/Controls/Accordion/Tweening/FloatTween.cs diff --git a/Scripts/Controls/Accordion/Tweening/FloatTween.cs.meta b/Runtime/Scripts/Controls/Accordion/Tweening/FloatTween.cs.meta similarity index 100% rename from Scripts/Controls/Accordion/Tweening/FloatTween.cs.meta rename to Runtime/Scripts/Controls/Accordion/Tweening/FloatTween.cs.meta diff --git a/Scripts/Controls/Accordion/Tweening/ITweenValue.cs b/Runtime/Scripts/Controls/Accordion/Tweening/ITweenValue.cs similarity index 100% rename from Scripts/Controls/Accordion/Tweening/ITweenValue.cs rename to Runtime/Scripts/Controls/Accordion/Tweening/ITweenValue.cs diff --git a/Scripts/Controls/Accordion/Tweening/ITweenValue.cs.meta b/Runtime/Scripts/Controls/Accordion/Tweening/ITweenValue.cs.meta similarity index 100% rename from Scripts/Controls/Accordion/Tweening/ITweenValue.cs.meta rename to Runtime/Scripts/Controls/Accordion/Tweening/ITweenValue.cs.meta diff --git a/Scripts/Controls/Accordion/Tweening/TweenRunner.cs b/Runtime/Scripts/Controls/Accordion/Tweening/TweenRunner.cs similarity index 100% rename from Scripts/Controls/Accordion/Tweening/TweenRunner.cs rename to Runtime/Scripts/Controls/Accordion/Tweening/TweenRunner.cs diff --git a/Scripts/Controls/Accordion/Tweening/TweenRunner.cs.meta b/Runtime/Scripts/Controls/Accordion/Tweening/TweenRunner.cs.meta similarity index 100% rename from Scripts/Controls/Accordion/Tweening/TweenRunner.cs.meta rename to Runtime/Scripts/Controls/Accordion/Tweening/TweenRunner.cs.meta diff --git a/Scripts/Controls/BoxSlider.cs b/Runtime/Scripts/Controls/BoxSlider.cs similarity index 100% rename from Scripts/Controls/BoxSlider.cs rename to Runtime/Scripts/Controls/BoxSlider.cs diff --git a/Scripts/Controls/BoxSlider.cs.meta b/Runtime/Scripts/Controls/BoxSlider.cs.meta similarity index 100% rename from Scripts/Controls/BoxSlider.cs.meta rename to Runtime/Scripts/Controls/BoxSlider.cs.meta diff --git a/Scripts/Controls/ColorPicker.meta b/Runtime/Scripts/Controls/ColorPicker.meta similarity index 100% rename from Scripts/Controls/ColorPicker.meta rename to Runtime/Scripts/Controls/ColorPicker.meta diff --git a/Scripts/Controls/ColorPicker/ColorImage.cs b/Runtime/Scripts/Controls/ColorPicker/ColorImage.cs similarity index 100% rename from Scripts/Controls/ColorPicker/ColorImage.cs rename to Runtime/Scripts/Controls/ColorPicker/ColorImage.cs diff --git a/Scripts/Controls/ColorPicker/ColorImage.cs.meta b/Runtime/Scripts/Controls/ColorPicker/ColorImage.cs.meta similarity index 100% rename from Scripts/Controls/ColorPicker/ColorImage.cs.meta rename to Runtime/Scripts/Controls/ColorPicker/ColorImage.cs.meta diff --git a/Scripts/Controls/ColorPicker/ColorLabel.cs b/Runtime/Scripts/Controls/ColorPicker/ColorLabel.cs similarity index 100% rename from Scripts/Controls/ColorPicker/ColorLabel.cs rename to Runtime/Scripts/Controls/ColorPicker/ColorLabel.cs diff --git a/Scripts/Controls/ColorPicker/ColorLabel.cs.meta b/Runtime/Scripts/Controls/ColorPicker/ColorLabel.cs.meta similarity index 100% rename from Scripts/Controls/ColorPicker/ColorLabel.cs.meta rename to Runtime/Scripts/Controls/ColorPicker/ColorLabel.cs.meta diff --git a/Scripts/Controls/ColorPicker/ColorPickerControl.cs b/Runtime/Scripts/Controls/ColorPicker/ColorPickerControl.cs similarity index 100% rename from Scripts/Controls/ColorPicker/ColorPickerControl.cs rename to Runtime/Scripts/Controls/ColorPicker/ColorPickerControl.cs diff --git a/Scripts/Controls/ColorPicker/ColorPickerControl.cs.meta b/Runtime/Scripts/Controls/ColorPicker/ColorPickerControl.cs.meta similarity index 100% rename from Scripts/Controls/ColorPicker/ColorPickerControl.cs.meta rename to Runtime/Scripts/Controls/ColorPicker/ColorPickerControl.cs.meta diff --git a/Scripts/Controls/ColorPicker/ColorPickerPresets.cs b/Runtime/Scripts/Controls/ColorPicker/ColorPickerPresets.cs similarity index 100% rename from Scripts/Controls/ColorPicker/ColorPickerPresets.cs rename to Runtime/Scripts/Controls/ColorPicker/ColorPickerPresets.cs diff --git a/Scripts/Controls/ColorPicker/ColorPickerPresets.cs.meta b/Runtime/Scripts/Controls/ColorPicker/ColorPickerPresets.cs.meta similarity index 100% rename from Scripts/Controls/ColorPicker/ColorPickerPresets.cs.meta rename to Runtime/Scripts/Controls/ColorPicker/ColorPickerPresets.cs.meta diff --git a/Scripts/Controls/ColorPicker/ColorPickerTester.cs b/Runtime/Scripts/Controls/ColorPicker/ColorPickerTester.cs similarity index 100% rename from Scripts/Controls/ColorPicker/ColorPickerTester.cs rename to Runtime/Scripts/Controls/ColorPicker/ColorPickerTester.cs diff --git a/Scripts/Controls/ColorPicker/ColorPickerTester.cs.meta b/Runtime/Scripts/Controls/ColorPicker/ColorPickerTester.cs.meta similarity index 100% rename from Scripts/Controls/ColorPicker/ColorPickerTester.cs.meta rename to Runtime/Scripts/Controls/ColorPicker/ColorPickerTester.cs.meta diff --git a/Scripts/Controls/ColorPicker/ColorSampler.cs b/Runtime/Scripts/Controls/ColorPicker/ColorSampler.cs similarity index 100% rename from Scripts/Controls/ColorPicker/ColorSampler.cs rename to Runtime/Scripts/Controls/ColorPicker/ColorSampler.cs diff --git a/Scripts/Controls/ColorPicker/ColorSampler.cs.meta b/Runtime/Scripts/Controls/ColorPicker/ColorSampler.cs.meta similarity index 100% rename from Scripts/Controls/ColorPicker/ColorSampler.cs.meta rename to Runtime/Scripts/Controls/ColorPicker/ColorSampler.cs.meta diff --git a/Scripts/Controls/ColorPicker/ColorSlider.cs b/Runtime/Scripts/Controls/ColorPicker/ColorSlider.cs similarity index 100% rename from Scripts/Controls/ColorPicker/ColorSlider.cs rename to Runtime/Scripts/Controls/ColorPicker/ColorSlider.cs diff --git a/Scripts/Controls/ColorPicker/ColorSlider.cs.meta b/Runtime/Scripts/Controls/ColorPicker/ColorSlider.cs.meta similarity index 100% rename from Scripts/Controls/ColorPicker/ColorSlider.cs.meta rename to Runtime/Scripts/Controls/ColorPicker/ColorSlider.cs.meta diff --git a/Scripts/Controls/ColorPicker/ColorSliderImage.cs b/Runtime/Scripts/Controls/ColorPicker/ColorSliderImage.cs similarity index 100% rename from Scripts/Controls/ColorPicker/ColorSliderImage.cs rename to Runtime/Scripts/Controls/ColorPicker/ColorSliderImage.cs diff --git a/Scripts/Controls/ColorPicker/ColorSliderImage.cs.meta b/Runtime/Scripts/Controls/ColorPicker/ColorSliderImage.cs.meta similarity index 100% rename from Scripts/Controls/ColorPicker/ColorSliderImage.cs.meta rename to Runtime/Scripts/Controls/ColorPicker/ColorSliderImage.cs.meta diff --git a/Scripts/Controls/ColorPicker/ColorValues.cs b/Runtime/Scripts/Controls/ColorPicker/ColorValues.cs similarity index 100% rename from Scripts/Controls/ColorPicker/ColorValues.cs rename to Runtime/Scripts/Controls/ColorPicker/ColorValues.cs diff --git a/Scripts/Controls/ColorPicker/ColorValues.cs.meta b/Runtime/Scripts/Controls/ColorPicker/ColorValues.cs.meta similarity index 100% rename from Scripts/Controls/ColorPicker/ColorValues.cs.meta rename to Runtime/Scripts/Controls/ColorPicker/ColorValues.cs.meta diff --git a/Scripts/Controls/ColorPicker/Events.meta b/Runtime/Scripts/Controls/ColorPicker/Events.meta similarity index 100% rename from Scripts/Controls/ColorPicker/Events.meta rename to Runtime/Scripts/Controls/ColorPicker/Events.meta diff --git a/Scripts/Controls/ColorPicker/Events/ColorChangedEvent.cs b/Runtime/Scripts/Controls/ColorPicker/Events/ColorChangedEvent.cs similarity index 100% rename from Scripts/Controls/ColorPicker/Events/ColorChangedEvent.cs rename to Runtime/Scripts/Controls/ColorPicker/Events/ColorChangedEvent.cs diff --git a/Scripts/Controls/ColorPicker/Events/ColorChangedEvent.cs.meta b/Runtime/Scripts/Controls/ColorPicker/Events/ColorChangedEvent.cs.meta similarity index 100% rename from Scripts/Controls/ColorPicker/Events/ColorChangedEvent.cs.meta rename to Runtime/Scripts/Controls/ColorPicker/Events/ColorChangedEvent.cs.meta diff --git a/Scripts/Controls/ColorPicker/Events/HSVChangedEvent.cs b/Runtime/Scripts/Controls/ColorPicker/Events/HSVChangedEvent.cs similarity index 100% rename from Scripts/Controls/ColorPicker/Events/HSVChangedEvent.cs rename to Runtime/Scripts/Controls/ColorPicker/Events/HSVChangedEvent.cs diff --git a/Scripts/Controls/ColorPicker/Events/HSVChangedEvent.cs.meta b/Runtime/Scripts/Controls/ColorPicker/Events/HSVChangedEvent.cs.meta similarity index 100% rename from Scripts/Controls/ColorPicker/Events/HSVChangedEvent.cs.meta rename to Runtime/Scripts/Controls/ColorPicker/Events/HSVChangedEvent.cs.meta diff --git a/Scripts/Controls/ColorPicker/HSVUtil.cs b/Runtime/Scripts/Controls/ColorPicker/HSVUtil.cs similarity index 100% rename from Scripts/Controls/ColorPicker/HSVUtil.cs rename to Runtime/Scripts/Controls/ColorPicker/HSVUtil.cs diff --git a/Scripts/Controls/ColorPicker/HSVUtil.cs.meta b/Runtime/Scripts/Controls/ColorPicker/HSVUtil.cs.meta similarity index 100% rename from Scripts/Controls/ColorPicker/HSVUtil.cs.meta rename to Runtime/Scripts/Controls/ColorPicker/HSVUtil.cs.meta diff --git a/Scripts/Controls/ColorPicker/HexColorField.cs b/Runtime/Scripts/Controls/ColorPicker/HexColorField.cs similarity index 100% rename from Scripts/Controls/ColorPicker/HexColorField.cs rename to Runtime/Scripts/Controls/ColorPicker/HexColorField.cs diff --git a/Scripts/Controls/ColorPicker/HexColorField.cs.meta b/Runtime/Scripts/Controls/ColorPicker/HexColorField.cs.meta similarity index 100% rename from Scripts/Controls/ColorPicker/HexColorField.cs.meta rename to Runtime/Scripts/Controls/ColorPicker/HexColorField.cs.meta diff --git a/Scripts/Controls/ColorPicker/SVBoxSlider.cs b/Runtime/Scripts/Controls/ColorPicker/SVBoxSlider.cs similarity index 100% rename from Scripts/Controls/ColorPicker/SVBoxSlider.cs rename to Runtime/Scripts/Controls/ColorPicker/SVBoxSlider.cs diff --git a/Scripts/Controls/ColorPicker/SVBoxSlider.cs.meta b/Runtime/Scripts/Controls/ColorPicker/SVBoxSlider.cs.meta similarity index 100% rename from Scripts/Controls/ColorPicker/SVBoxSlider.cs.meta rename to Runtime/Scripts/Controls/ColorPicker/SVBoxSlider.cs.meta diff --git a/Scripts/Controls/ColorPicker/TiltWindow.cs b/Runtime/Scripts/Controls/ColorPicker/TiltWindow.cs similarity index 100% rename from Scripts/Controls/ColorPicker/TiltWindow.cs rename to Runtime/Scripts/Controls/ColorPicker/TiltWindow.cs diff --git a/Scripts/Controls/ColorPicker/TiltWindow.cs.meta b/Runtime/Scripts/Controls/ColorPicker/TiltWindow.cs.meta similarity index 100% rename from Scripts/Controls/ColorPicker/TiltWindow.cs.meta rename to Runtime/Scripts/Controls/ColorPicker/TiltWindow.cs.meta diff --git a/Scripts/Controls/ComboBox.meta b/Runtime/Scripts/Controls/ComboBox.meta similarity index 100% rename from Scripts/Controls/ComboBox.meta rename to Runtime/Scripts/Controls/ComboBox.meta diff --git a/Scripts/Controls/ComboBox/AutoCompleteComboBox.cs b/Runtime/Scripts/Controls/ComboBox/AutoCompleteComboBox.cs similarity index 96% rename from Scripts/Controls/ComboBox/AutoCompleteComboBox.cs rename to Runtime/Scripts/Controls/ComboBox/AutoCompleteComboBox.cs index ae623f5..04274c1 100644 --- a/Scripts/Controls/ComboBox/AutoCompleteComboBox.cs +++ b/Runtime/Scripts/Controls/ComboBox/AutoCompleteComboBox.cs @@ -43,8 +43,8 @@ namespace UnityEngine.UI.Extensions private ScrollRect _scrollRect; - private List<string> _panelItems; //items that will get shown in the dropdown - private List<string> _prunedPanelItems; //items that used to show in the dropdown + private List<string> _panelItems; //items that will get shown in the drop-down + private List<string> _prunedPanelItems; //items that used to show in the drop-down private Dictionary<string, GameObject> panelObjects; @@ -118,7 +118,7 @@ namespace UnityEngine.UI.Extensions // fires when input text is changed; public SelectionTextChangedEvent OnSelectionTextChanged; - // fires when when an Item gets selected / deselected (including when items are added/removed once this is possible) + // fires when an Item gets selected / deselected (including when items are added/removed once this is possible) public SelectionValidityChangedEvent OnSelectionValidityChanged; // fires in both cases public SelectionChangedEvent OnSelectionChanged; @@ -171,7 +171,7 @@ namespace UnityEngine.UI.Extensions catch (System.NullReferenceException ex) { Debug.LogException(ex); - Debug.LogError("Something is setup incorrectly with the dropdownlist component causing a Null Refernece Exception"); + Debug.LogError("Something is setup incorrectly with the dropdownlist component causing a Null Reference Exception"); success = false; } panelObjects = new Dictionary<string, GameObject>(); diff --git a/Scripts/Controls/ComboBox/AutoCompleteComboBox.cs.meta b/Runtime/Scripts/Controls/ComboBox/AutoCompleteComboBox.cs.meta similarity index 100% rename from Scripts/Controls/ComboBox/AutoCompleteComboBox.cs.meta rename to Runtime/Scripts/Controls/ComboBox/AutoCompleteComboBox.cs.meta diff --git a/Scripts/Controls/ComboBox/ComboBox.cs b/Runtime/Scripts/Controls/ComboBox/ComboBox.cs similarity index 96% rename from Scripts/Controls/ComboBox/ComboBox.cs rename to Runtime/Scripts/Controls/ComboBox/ComboBox.cs index dd48145..156cd1a 100644 --- a/Scripts/Controls/ComboBox/ComboBox.cs +++ b/Runtime/Scripts/Controls/ComboBox/ComboBox.cs @@ -49,7 +49,7 @@ namespace UnityEngine.UI.Extensions private ScrollRect _scrollRect; - private List<string> _panelItems; //items that will get shown in the dropdown + private List<string> _panelItems; //items that will get shown in the drop-down private Dictionary<string, GameObject> panelObjects; @@ -119,7 +119,7 @@ namespace UnityEngine.UI.Extensions catch (System.NullReferenceException ex) { Debug.LogException(ex); - Debug.LogError("Something is setup incorrectly with the dropdownlist component causing a Null Refernece Exception"); + Debug.LogError("Something is setup incorrectly with the dropdownlist component causing a Null Reference Exception"); success = false; } panelObjects = new Dictionary<string, GameObject>(); diff --git a/Scripts/Controls/ComboBox/ComboBox.cs.meta b/Runtime/Scripts/Controls/ComboBox/ComboBox.cs.meta similarity index 100% rename from Scripts/Controls/ComboBox/ComboBox.cs.meta rename to Runtime/Scripts/Controls/ComboBox/ComboBox.cs.meta diff --git a/Scripts/Controls/ComboBox/DropDownList.cs b/Runtime/Scripts/Controls/ComboBox/DropDownList.cs similarity index 100% rename from Scripts/Controls/ComboBox/DropDownList.cs rename to Runtime/Scripts/Controls/ComboBox/DropDownList.cs diff --git a/Scripts/Controls/ComboBox/DropDownList.cs.meta b/Runtime/Scripts/Controls/ComboBox/DropDownList.cs.meta similarity index 100% rename from Scripts/Controls/ComboBox/DropDownList.cs.meta rename to Runtime/Scripts/Controls/ComboBox/DropDownList.cs.meta diff --git a/Scripts/Controls/ComboBox/DropDownListButton.cs b/Runtime/Scripts/Controls/ComboBox/DropDownListButton.cs similarity index 100% rename from Scripts/Controls/ComboBox/DropDownListButton.cs rename to Runtime/Scripts/Controls/ComboBox/DropDownListButton.cs diff --git a/Scripts/Controls/ComboBox/DropDownListButton.cs.meta b/Runtime/Scripts/Controls/ComboBox/DropDownListButton.cs.meta similarity index 100% rename from Scripts/Controls/ComboBox/DropDownListButton.cs.meta rename to Runtime/Scripts/Controls/ComboBox/DropDownListButton.cs.meta diff --git a/Scripts/Controls/ComboBox/DropDownListItem.cs b/Runtime/Scripts/Controls/ComboBox/DropDownListItem.cs similarity index 94% rename from Scripts/Controls/ComboBox/DropDownListItem.cs rename to Runtime/Scripts/Controls/ComboBox/DropDownListItem.cs index dbada62..e89eeeb 100644 --- a/Scripts/Controls/ComboBox/DropDownListItem.cs +++ b/Runtime/Scripts/Controls/ComboBox/DropDownListItem.cs @@ -68,7 +68,7 @@ namespace UnityEngine.UI.Extensions [SerializeField] private string _id; ///<summary> - ///ID exists so that an item can have a caption and a value like in traditional windows forms. Ie. an item may be a student's name, and the ID can be the student's ID number + ///ID exists so that an item can have a caption and a value like in traditional windows forms. IE. an item may be a student's name, and the ID can be the student's ID number ///</summary> public string ID { diff --git a/Scripts/Controls/ComboBox/DropDownListItem.cs.meta b/Runtime/Scripts/Controls/ComboBox/DropDownListItem.cs.meta similarity index 100% rename from Scripts/Controls/ComboBox/DropDownListItem.cs.meta rename to Runtime/Scripts/Controls/ComboBox/DropDownListItem.cs.meta diff --git a/Scripts/Controls/CooldownButton.cs b/Runtime/Scripts/Controls/CooldownButton.cs similarity index 100% rename from Scripts/Controls/CooldownButton.cs rename to Runtime/Scripts/Controls/CooldownButton.cs diff --git a/Scripts/Controls/CooldownButton.cs.meta b/Runtime/Scripts/Controls/CooldownButton.cs.meta similarity index 100% rename from Scripts/Controls/CooldownButton.cs.meta rename to Runtime/Scripts/Controls/CooldownButton.cs.meta diff --git a/Scripts/Controls/InputFocus.cs b/Runtime/Scripts/Controls/InputFocus.cs similarity index 100% rename from Scripts/Controls/InputFocus.cs rename to Runtime/Scripts/Controls/InputFocus.cs diff --git a/Scripts/Controls/InputFocus.cs.meta b/Runtime/Scripts/Controls/InputFocus.cs.meta similarity index 100% rename from Scripts/Controls/InputFocus.cs.meta rename to Runtime/Scripts/Controls/InputFocus.cs.meta diff --git a/Scripts/Controls/MultiTouchScrollRect.cs b/Runtime/Scripts/Controls/MultiTouchScrollRect.cs similarity index 100% rename from Scripts/Controls/MultiTouchScrollRect.cs rename to Runtime/Scripts/Controls/MultiTouchScrollRect.cs diff --git a/Scripts/Controls/MultiTouchScrollRect.cs.meta b/Runtime/Scripts/Controls/MultiTouchScrollRect.cs.meta similarity index 100% rename from Scripts/Controls/MultiTouchScrollRect.cs.meta rename to Runtime/Scripts/Controls/MultiTouchScrollRect.cs.meta diff --git a/Scripts/Controls/RadialSlider.cs b/Runtime/Scripts/Controls/RadialSlider.cs similarity index 99% rename from Scripts/Controls/RadialSlider.cs rename to Runtime/Scripts/Controls/RadialSlider.cs index 972c6e2..7bb5672 100644 --- a/Scripts/Controls/RadialSlider.cs +++ b/Runtime/Scripts/Controls/RadialSlider.cs @@ -1,6 +1,6 @@ /// Credit mgear, SimonDarksideJ /// Sourced from - https://forum.unity3d.com/threads/radial-slider-circle-slider.326392/#post-3143582 -/// Updated to include lerping features and programatic access to angle/value +/// Updated to include lerping features and programmatic access to angle/value using System; using UnityEngine.Events; diff --git a/Scripts/Controls/RadialSlider.cs.meta b/Runtime/Scripts/Controls/RadialSlider.cs.meta similarity index 100% rename from Scripts/Controls/RadialSlider.cs.meta rename to Runtime/Scripts/Controls/RadialSlider.cs.meta diff --git a/Scripts/Controls/RangeSlider.cs b/Runtime/Scripts/Controls/RangeSlider.cs similarity index 99% rename from Scripts/Controls/RangeSlider.cs rename to Runtime/Scripts/Controls/RangeSlider.cs index d19a074..d9fe89c 100644 --- a/Scripts/Controls/RangeSlider.cs +++ b/Runtime/Scripts/Controls/RangeSlider.cs @@ -439,7 +439,7 @@ namespace UnityEngine.UI.Extensions void UpdateDrag(PointerEventData eventData, Camera cam) { //this needs to differ from slider in that we have two handles, and need to move the right one. - //and if it was neither handle, we will have a seperate case where both handles move uniformly + //and if it was neither handle, we will have a separate case where both handles move uniformly //moving the entire range //this is where we use our interationState diff --git a/Scripts/Controls/RangeSlider.cs.meta b/Runtime/Scripts/Controls/RangeSlider.cs.meta similarity index 100% rename from Scripts/Controls/RangeSlider.cs.meta rename to Runtime/Scripts/Controls/RangeSlider.cs.meta diff --git a/Scripts/Controls/ReorderableList.meta b/Runtime/Scripts/Controls/ReorderableList.meta similarity index 100% rename from Scripts/Controls/ReorderableList.meta rename to Runtime/Scripts/Controls/ReorderableList.meta diff --git a/Scripts/Controls/ReorderableList/ReorderableList.cs b/Runtime/Scripts/Controls/ReorderableList/ReorderableList.cs similarity index 100% rename from Scripts/Controls/ReorderableList/ReorderableList.cs rename to Runtime/Scripts/Controls/ReorderableList/ReorderableList.cs diff --git a/Scripts/Controls/ReorderableList/ReorderableList.cs.meta b/Runtime/Scripts/Controls/ReorderableList/ReorderableList.cs.meta similarity index 100% rename from Scripts/Controls/ReorderableList/ReorderableList.cs.meta rename to Runtime/Scripts/Controls/ReorderableList/ReorderableList.cs.meta diff --git a/Scripts/Controls/ReorderableList/ReorderableListContent.cs b/Runtime/Scripts/Controls/ReorderableList/ReorderableListContent.cs similarity index 95% rename from Scripts/Controls/ReorderableList/ReorderableListContent.cs rename to Runtime/Scripts/Controls/ReorderableList/ReorderableListContent.cs index 37287f6..9ef2e7a 100644 --- a/Scripts/Controls/ReorderableList/ReorderableListContent.cs +++ b/Runtime/Scripts/Controls/ReorderableList/ReorderableListContent.cs @@ -37,7 +37,7 @@ namespace UnityEngine.UI.Extensions private IEnumerator RefreshChildren() { - //Handle new chilren + //Handle new children for (int i = 0; i < _rect.childCount; i++) { if (_cachedChildren.Contains(_rect.GetChild(i))) diff --git a/Scripts/Controls/ReorderableList/ReorderableListContent.cs.meta b/Runtime/Scripts/Controls/ReorderableList/ReorderableListContent.cs.meta similarity index 100% rename from Scripts/Controls/ReorderableList/ReorderableListContent.cs.meta rename to Runtime/Scripts/Controls/ReorderableList/ReorderableListContent.cs.meta diff --git a/Scripts/Controls/ReorderableList/ReorderableListDebug.cs b/Runtime/Scripts/Controls/ReorderableList/ReorderableListDebug.cs similarity index 100% rename from Scripts/Controls/ReorderableList/ReorderableListDebug.cs rename to Runtime/Scripts/Controls/ReorderableList/ReorderableListDebug.cs diff --git a/Scripts/Controls/ReorderableList/ReorderableListDebug.cs.meta b/Runtime/Scripts/Controls/ReorderableList/ReorderableListDebug.cs.meta similarity index 100% rename from Scripts/Controls/ReorderableList/ReorderableListDebug.cs.meta rename to Runtime/Scripts/Controls/ReorderableList/ReorderableListDebug.cs.meta diff --git a/Scripts/Controls/ReorderableList/ReorderableListElement.cs b/Runtime/Scripts/Controls/ReorderableList/ReorderableListElement.cs similarity index 97% rename from Scripts/Controls/ReorderableList/ReorderableListElement.cs rename to Runtime/Scripts/Controls/ReorderableList/ReorderableListElement.cs index adcee13..47750e9 100644 --- a/Scripts/Controls/ReorderableList/ReorderableListElement.cs +++ b/Runtime/Scripts/Controls/ReorderableList/ReorderableListElement.cs @@ -1,6 +1,6 @@ /// Credit Ziboo, Andrew Quesenberry /// Sourced from - http://forum.unity3d.com/threads/free-reorderable-list.364600/ -/// Last Child Fix - https://bitbucket.org/ddreaper/unity-ui-extensions/issues/70/all-re-orderable-lists-cause-a-transform +/// Last Child Fix - https://bitbucket.org/SimonDarksideJ/unity-ui-extensions/issues/70/all-re-orderable-lists-cause-a-transform using System; using System.Collections.Generic; @@ -160,7 +160,7 @@ namespace UnityEngine.UI.Extensions } } - //If nothing found or the list is not dropable, put the fake element outsite + //If nothing found or the list is not dropable, put the fake element outside if (_currentReorderableListRaycasted == null || _currentReorderableListRaycasted.IsDropable == false || (_oldReorderableListRaycasted != _reorderableList && !IsTransferable) || ((_fakeElement.parent == _currentReorderableListRaycasted.Content @@ -484,7 +484,7 @@ namespace UnityEngine.UI.Extensions _reorderableList.OnElementAdded.Invoke(args); if (!isValid) - throw new Exception("Transfer is already Cancelled."); + throw new Exception("Transfer is already Canceled."); } diff --git a/Scripts/Controls/ReorderableList/ReorderableListElement.cs.meta b/Runtime/Scripts/Controls/ReorderableList/ReorderableListElement.cs.meta similarity index 100% rename from Scripts/Controls/ReorderableList/ReorderableListElement.cs.meta rename to Runtime/Scripts/Controls/ReorderableList/ReorderableListElement.cs.meta diff --git a/Scripts/Controls/RescalingPanels.meta b/Runtime/Scripts/Controls/RescalingPanels.meta similarity index 100% rename from Scripts/Controls/RescalingPanels.meta rename to Runtime/Scripts/Controls/RescalingPanels.meta diff --git a/Scripts/Controls/RescalingPanels/RescaleDragPanel.cs b/Runtime/Scripts/Controls/RescalingPanels/RescaleDragPanel.cs similarity index 100% rename from Scripts/Controls/RescalingPanels/RescaleDragPanel.cs rename to Runtime/Scripts/Controls/RescalingPanels/RescaleDragPanel.cs diff --git a/Scripts/Controls/RescalingPanels/RescaleDragPanel.cs.meta b/Runtime/Scripts/Controls/RescalingPanels/RescaleDragPanel.cs.meta similarity index 100% rename from Scripts/Controls/RescalingPanels/RescaleDragPanel.cs.meta rename to Runtime/Scripts/Controls/RescalingPanels/RescaleDragPanel.cs.meta diff --git a/Scripts/Controls/RescalingPanels/RescalePanel.cs b/Runtime/Scripts/Controls/RescalingPanels/RescalePanel.cs similarity index 100% rename from Scripts/Controls/RescalingPanels/RescalePanel.cs rename to Runtime/Scripts/Controls/RescalingPanels/RescalePanel.cs diff --git a/Scripts/Controls/RescalingPanels/RescalePanel.cs.meta b/Runtime/Scripts/Controls/RescalingPanels/RescalePanel.cs.meta similarity index 100% rename from Scripts/Controls/RescalingPanels/RescalePanel.cs.meta rename to Runtime/Scripts/Controls/RescalingPanels/RescalePanel.cs.meta diff --git a/Scripts/Controls/RescalingPanels/ResizePanel.cs b/Runtime/Scripts/Controls/RescalingPanels/ResizePanel.cs similarity index 100% rename from Scripts/Controls/RescalingPanels/ResizePanel.cs rename to Runtime/Scripts/Controls/RescalingPanels/ResizePanel.cs diff --git a/Scripts/Controls/RescalingPanels/ResizePanel.cs.meta b/Runtime/Scripts/Controls/RescalingPanels/ResizePanel.cs.meta similarity index 100% rename from Scripts/Controls/RescalingPanels/ResizePanel.cs.meta rename to Runtime/Scripts/Controls/RescalingPanels/ResizePanel.cs.meta diff --git a/Scripts/Controls/Segment.cs b/Runtime/Scripts/Controls/Segment.cs similarity index 100% rename from Scripts/Controls/Segment.cs rename to Runtime/Scripts/Controls/Segment.cs diff --git a/Scripts/Controls/Segment.cs.meta b/Runtime/Scripts/Controls/Segment.cs.meta similarity index 100% rename from Scripts/Controls/Segment.cs.meta rename to Runtime/Scripts/Controls/Segment.cs.meta diff --git a/Scripts/Controls/SegmentedControl.cs b/Runtime/Scripts/Controls/SegmentedControl.cs similarity index 100% rename from Scripts/Controls/SegmentedControl.cs rename to Runtime/Scripts/Controls/SegmentedControl.cs diff --git a/Scripts/Controls/SegmentedControl.cs.meta b/Runtime/Scripts/Controls/SegmentedControl.cs.meta similarity index 100% rename from Scripts/Controls/SegmentedControl.cs.meta rename to Runtime/Scripts/Controls/SegmentedControl.cs.meta diff --git a/Scripts/Controls/SelectionBox.meta b/Runtime/Scripts/Controls/SelectionBox.meta similarity index 100% rename from Scripts/Controls/SelectionBox.meta rename to Runtime/Scripts/Controls/SelectionBox.meta diff --git a/Scripts/Controls/SelectionBox/ExampleSelectable.cs b/Runtime/Scripts/Controls/SelectionBox/ExampleSelectable.cs similarity index 100% rename from Scripts/Controls/SelectionBox/ExampleSelectable.cs rename to Runtime/Scripts/Controls/SelectionBox/ExampleSelectable.cs diff --git a/Scripts/Controls/SelectionBox/ExampleSelectable.cs.meta b/Runtime/Scripts/Controls/SelectionBox/ExampleSelectable.cs.meta similarity index 100% rename from Scripts/Controls/SelectionBox/ExampleSelectable.cs.meta rename to Runtime/Scripts/Controls/SelectionBox/ExampleSelectable.cs.meta diff --git a/Scripts/Controls/SelectionBox/IBoxSelectable.cs b/Runtime/Scripts/Controls/SelectionBox/IBoxSelectable.cs similarity index 100% rename from Scripts/Controls/SelectionBox/IBoxSelectable.cs rename to Runtime/Scripts/Controls/SelectionBox/IBoxSelectable.cs diff --git a/Scripts/Controls/SelectionBox/IBoxSelectable.cs.meta b/Runtime/Scripts/Controls/SelectionBox/IBoxSelectable.cs.meta similarity index 100% rename from Scripts/Controls/SelectionBox/IBoxSelectable.cs.meta rename to Runtime/Scripts/Controls/SelectionBox/IBoxSelectable.cs.meta diff --git a/Scripts/Controls/SelectionBox/SelectionBox.cs b/Runtime/Scripts/Controls/SelectionBox/SelectionBox.cs similarity index 93% rename from Scripts/Controls/SelectionBox/SelectionBox.cs rename to Runtime/Scripts/Controls/SelectionBox/SelectionBox.cs index 3d73cf0..ca99161 100644 --- a/Scripts/Controls/SelectionBox/SelectionBox.cs +++ b/Runtime/Scripts/Controls/SelectionBox/SelectionBox.cs @@ -41,13 +41,13 @@ namespace UnityEngine.UI.Extensions // An optional parameter, but you can add a sprite to the selection box to give it a border or a stylized look. // It's suggested you use a monochrome sprite so that the selection - // Box color is still relevent. + // Box color is still relevant. public Sprite art; // Will store the location of wherever we first click before dragging. private Vector2 origin; - // A rectTransform set by the User that can limit which part of the screen is eligable for drag selection + // A rectTransform set by the User that can limit which part of the screen is eligible for drag selection public RectTransform selectionMask; //Stores the rectTransform connected to the generated gameObject being used for the selection box visuals @@ -199,7 +199,7 @@ namespace UnityEngine.UI.Extensions } bool PointIsValidAgainstSelectionMask(Vector2 screenPoint){ - //If there is no seleciton mask, any point is valid + //If there is no selection mask, any point is valid if (!selectionMask) { return true; } @@ -215,14 +215,14 @@ namespace UnityEngine.UI.Extensions return null; } - //This gets a bit tricky, because we have to make considerations depending on the heirarchy of the selectable's gameObject + //This gets a bit tricky, because we have to make considerations depending on the hierarchy of the selectable's gameObject foreach (var selectable in selectables) { //First we check to see if the selectable has a rectTransform var rectTransform = (selectable.transform as RectTransform); if (rectTransform) { - //Because if it does, the camera we use to calulate it's screen point will vary + //Because if it does, the camera we use to calculate it's screen point will vary var screenCamera = GetScreenPointCamera(rectTransform); //Once we've found the rendering camera, we check if the selectables rectTransform contains the click. That way we @@ -290,7 +290,7 @@ namespace UnityEngine.UI.Extensions Vector3 screenPoint = GetScreenPointOfSelectable(selectable); - //If the box Rect contains the selectabels screen point and that point is inside a valid selection mask, it's being preselected, otherwise it is not. + //If the box Rect contains the selectables screen point and that point is inside a valid selection mask, it's being preselected, otherwise it is not. selectable.preSelected = RectTransformUtility.RectangleContainsScreenPoint(boxRect, screenPoint, null) && PointIsValidAgainstSelectionMask(screenPoint); } @@ -331,12 +331,12 @@ namespace UnityEngine.UI.Extensions } Vector2 GetScreenPointOfSelectable(IBoxSelectable selectable) { - //Getting the screen point requires it's own function, because we have to take into consideration the selectables heirarchy. + //Getting the screen point requires it's own function, because we have to take into consideration the selectables hierarchy. //Cast the transform as a rectTransform var rectTransform = selectable.transform as RectTransform; - //If it has a rectTransform component, it must be in the heirarchy of a canvas, somewhere. + //If it has a rectTransform component, it must be in the hierarchy of a canvas, somewhere. if (rectTransform) { //And the camera used to calculate it's screen point will vary. @@ -345,7 +345,7 @@ namespace UnityEngine.UI.Extensions return RectTransformUtility.WorldToScreenPoint(renderingCamera, selectable.transform.position); } - //If it's no in the heirarchy of a canvas, the regular Camera.main.WorldToScreenPoint will do. + //If it's no in the hierarchy of a canvas, the regular Camera.main.WorldToScreenPoint will do. return Camera.main.WorldToScreenPoint(selectable.transform.position); } @@ -363,7 +363,7 @@ namespace UnityEngine.UI.Extensions Canvas rootCanvas = null; RectTransform rectCheck = rectTransform; - //We're going to check all the canvases in the heirarchy of this rectTransform until we find the root. + //We're going to check all the canvases in the hierarchy of this rectTransform until we find the root. do { rootCanvas = rectCheck.GetComponent<Canvas>(); diff --git a/Scripts/Controls/SelectionBox/SelectionBox.cs.meta b/Runtime/Scripts/Controls/SelectionBox/SelectionBox.cs.meta similarity index 100% rename from Scripts/Controls/SelectionBox/SelectionBox.cs.meta rename to Runtime/Scripts/Controls/SelectionBox/SelectionBox.cs.meta diff --git a/Scripts/Controls/Stepper.cs b/Runtime/Scripts/Controls/Stepper.cs similarity index 100% rename from Scripts/Controls/Stepper.cs rename to Runtime/Scripts/Controls/Stepper.cs diff --git a/Scripts/Controls/Stepper.cs.meta b/Runtime/Scripts/Controls/Stepper.cs.meta similarity index 100% rename from Scripts/Controls/Stepper.cs.meta rename to Runtime/Scripts/Controls/Stepper.cs.meta diff --git a/Scripts/Controls/StepperSide.cs b/Runtime/Scripts/Controls/StepperSide.cs similarity index 100% rename from Scripts/Controls/StepperSide.cs rename to Runtime/Scripts/Controls/StepperSide.cs diff --git a/Scripts/Controls/StepperSide.cs.meta b/Runtime/Scripts/Controls/StepperSide.cs.meta similarity index 100% rename from Scripts/Controls/StepperSide.cs.meta rename to Runtime/Scripts/Controls/StepperSide.cs.meta diff --git a/Scripts/Controls/TextPic.cs b/Runtime/Scripts/Controls/TextPic.cs similarity index 100% rename from Scripts/Controls/TextPic.cs rename to Runtime/Scripts/Controls/TextPic.cs diff --git a/Scripts/Controls/TextPic.cs.meta b/Runtime/Scripts/Controls/TextPic.cs.meta similarity index 100% rename from Scripts/Controls/TextPic.cs.meta rename to Runtime/Scripts/Controls/TextPic.cs.meta diff --git a/Scripts/Controls/UI_Knob.cs b/Runtime/Scripts/Controls/UI_Knob.cs similarity index 95% rename from Scripts/Controls/UI_Knob.cs rename to Runtime/Scripts/Controls/UI_Knob.cs index e7582ae..f3e4396 100644 --- a/Scripts/Controls/UI_Knob.cs +++ b/Runtime/Scripts/Controls/UI_Knob.cs @@ -1,5 +1,5 @@ /// Credit Tomasz Schelenz -/// Sourced from - https://bitbucket.org/ddreaper/unity-ui-extensions/issues/46/feature-uiknob#comment-29243988 +/// Sourced from - https://bitbucket.org/SimonDarksideJ/unity-ui-extensions/issues/46/feature-uiknob#comment-29243988 using UnityEngine.Events; using UnityEngine.EventSystems; diff --git a/Scripts/Controls/UI_Knob.cs.meta b/Runtime/Scripts/Controls/UI_Knob.cs.meta similarity index 100% rename from Scripts/Controls/UI_Knob.cs.meta rename to Runtime/Scripts/Controls/UI_Knob.cs.meta diff --git a/Scripts/Effects.meta b/Runtime/Scripts/Effects.meta similarity index 100% rename from Scripts/Effects.meta rename to Runtime/Scripts/Effects.meta diff --git a/Scripts/Effects/BestFitOutline.cs b/Runtime/Scripts/Effects/BestFitOutline.cs similarity index 100% rename from Scripts/Effects/BestFitOutline.cs rename to Runtime/Scripts/Effects/BestFitOutline.cs diff --git a/Scripts/Effects/BestFitOutline.cs.meta b/Runtime/Scripts/Effects/BestFitOutline.cs.meta similarity index 100% rename from Scripts/Effects/BestFitOutline.cs.meta rename to Runtime/Scripts/Effects/BestFitOutline.cs.meta diff --git a/Scripts/Effects/CurlyUI.meta b/Runtime/Scripts/Effects/CurlyUI.meta similarity index 100% rename from Scripts/Effects/CurlyUI.meta rename to Runtime/Scripts/Effects/CurlyUI.meta diff --git a/Scripts/Effects/CurlyUI/CUIBezierCurve.cs b/Runtime/Scripts/Effects/CurlyUI/CUIBezierCurve.cs similarity index 100% rename from Scripts/Effects/CurlyUI/CUIBezierCurve.cs rename to Runtime/Scripts/Effects/CurlyUI/CUIBezierCurve.cs diff --git a/Scripts/Effects/CurlyUI/CUIBezierCurve.cs.meta b/Runtime/Scripts/Effects/CurlyUI/CUIBezierCurve.cs.meta similarity index 100% rename from Scripts/Effects/CurlyUI/CUIBezierCurve.cs.meta rename to Runtime/Scripts/Effects/CurlyUI/CUIBezierCurve.cs.meta diff --git a/Scripts/Effects/CurlyUI/CUIGraphic.cs b/Runtime/Scripts/Effects/CurlyUI/CUIGraphic.cs similarity index 99% rename from Scripts/Effects/CurlyUI/CUIGraphic.cs rename to Runtime/Scripts/Effects/CurlyUI/CUIGraphic.cs index c324301..dbdc39b 100644 --- a/Scripts/Effects/CurlyUI/CUIGraphic.cs +++ b/Runtime/Scripts/Effects/CurlyUI/CUIGraphic.cs @@ -58,7 +58,7 @@ namespace UnityEngine.UI.Extensions #endregion /// <summary> - /// Refernce to other objects that are needed by this object. + /// Reference to other objects that are needed by this object. /// </summary> #region Links @@ -273,7 +273,7 @@ namespace UnityEngine.UI.Extensions #endregion - // Events are for handling reoccuring function calls that react to the changes of the environment. + // Events are for handling reoccurring function calls that react to the changes of the environment. #region Events protected override void OnRectTransformDimensionsChange() diff --git a/Scripts/Effects/CurlyUI/CUIGraphic.cs.meta b/Runtime/Scripts/Effects/CurlyUI/CUIGraphic.cs.meta similarity index 100% rename from Scripts/Effects/CurlyUI/CUIGraphic.cs.meta rename to Runtime/Scripts/Effects/CurlyUI/CUIGraphic.cs.meta diff --git a/Scripts/Effects/CurlyUI/CUIImage.cs b/Runtime/Scripts/Effects/CurlyUI/CUIImage.cs similarity index 99% rename from Scripts/Effects/CurlyUI/CUIImage.cs rename to Runtime/Scripts/Effects/CurlyUI/CUIImage.cs index 6506544..9adc188 100644 --- a/Scripts/Effects/CurlyUI/CUIImage.cs +++ b/Runtime/Scripts/Effects/CurlyUI/CUIImage.cs @@ -95,7 +95,7 @@ namespace UnityEngine.UI.Extensions } - // constraing the corner ratio + // constraining the corner ratio if (cornerPosRatio.x < 0) { cornerPosRatio.x = 0; diff --git a/Scripts/Effects/CurlyUI/CUIImage.cs.meta b/Runtime/Scripts/Effects/CurlyUI/CUIImage.cs.meta similarity index 100% rename from Scripts/Effects/CurlyUI/CUIImage.cs.meta rename to Runtime/Scripts/Effects/CurlyUI/CUIImage.cs.meta diff --git a/Scripts/Effects/CurlyUI/CUIMisc.cs b/Runtime/Scripts/Effects/CurlyUI/CUIMisc.cs similarity index 100% rename from Scripts/Effects/CurlyUI/CUIMisc.cs rename to Runtime/Scripts/Effects/CurlyUI/CUIMisc.cs diff --git a/Scripts/Effects/CurlyUI/CUIMisc.cs.meta b/Runtime/Scripts/Effects/CurlyUI/CUIMisc.cs.meta similarity index 100% rename from Scripts/Effects/CurlyUI/CUIMisc.cs.meta rename to Runtime/Scripts/Effects/CurlyUI/CUIMisc.cs.meta diff --git a/Scripts/Effects/CurlyUI/CUIText.cs b/Runtime/Scripts/Effects/CurlyUI/CUIText.cs similarity index 100% rename from Scripts/Effects/CurlyUI/CUIText.cs rename to Runtime/Scripts/Effects/CurlyUI/CUIText.cs diff --git a/Scripts/Effects/CurlyUI/CUIText.cs.meta b/Runtime/Scripts/Effects/CurlyUI/CUIText.cs.meta similarity index 100% rename from Scripts/Effects/CurlyUI/CUIText.cs.meta rename to Runtime/Scripts/Effects/CurlyUI/CUIText.cs.meta diff --git a/Scripts/Effects/CurvedText.cs b/Runtime/Scripts/Effects/CurvedText.cs similarity index 100% rename from Scripts/Effects/CurvedText.cs rename to Runtime/Scripts/Effects/CurvedText.cs diff --git a/Scripts/Effects/CurvedText.cs.meta b/Runtime/Scripts/Effects/CurvedText.cs.meta similarity index 100% rename from Scripts/Effects/CurvedText.cs.meta rename to Runtime/Scripts/Effects/CurvedText.cs.meta diff --git a/Scripts/Effects/CylinderText.cs b/Runtime/Scripts/Effects/CylinderText.cs similarity index 100% rename from Scripts/Effects/CylinderText.cs rename to Runtime/Scripts/Effects/CylinderText.cs diff --git a/Scripts/Effects/CylinderText.cs.meta b/Runtime/Scripts/Effects/CylinderText.cs.meta similarity index 100% rename from Scripts/Effects/CylinderText.cs.meta rename to Runtime/Scripts/Effects/CylinderText.cs.meta diff --git a/Scripts/Effects/Gradient.cs b/Runtime/Scripts/Effects/Gradient.cs similarity index 100% rename from Scripts/Effects/Gradient.cs rename to Runtime/Scripts/Effects/Gradient.cs diff --git a/Scripts/Effects/Gradient.cs.meta b/Runtime/Scripts/Effects/Gradient.cs.meta similarity index 100% rename from Scripts/Effects/Gradient.cs.meta rename to Runtime/Scripts/Effects/Gradient.cs.meta diff --git a/Scripts/Effects/Gradient2.cs b/Runtime/Scripts/Effects/Gradient2.cs similarity index 100% rename from Scripts/Effects/Gradient2.cs rename to Runtime/Scripts/Effects/Gradient2.cs diff --git a/Scripts/Effects/Gradient2.cs.meta b/Runtime/Scripts/Effects/Gradient2.cs.meta similarity index 100% rename from Scripts/Effects/Gradient2.cs.meta rename to Runtime/Scripts/Effects/Gradient2.cs.meta diff --git a/Scripts/Effects/LetterSpacing.cs b/Runtime/Scripts/Effects/LetterSpacing.cs similarity index 96% rename from Scripts/Effects/LetterSpacing.cs rename to Runtime/Scripts/Effects/LetterSpacing.cs index 3fc7e44..9e305e7 100644 --- a/Scripts/Effects/LetterSpacing.cs +++ b/Runtime/Scripts/Effects/LetterSpacing.cs @@ -15,7 +15,7 @@ rather primitive, but I can't see any better way at the moment. It means that all sorts of things can break the effect... This component should be placed higher in component list than any other vertex -modifiers that alter the total number of vertices. Eg, place this above Shadow +modifiers that alter the total number of vertices. EG, place this above Shadow or Outline effects. If you don't, the outline/shadow won't match the position of the letters properly. If you place the outline/shadow effect second however, it will just work on the altered vertices from this component, and function diff --git a/Scripts/Effects/LetterSpacing.cs.meta b/Runtime/Scripts/Effects/LetterSpacing.cs.meta similarity index 100% rename from Scripts/Effects/LetterSpacing.cs.meta rename to Runtime/Scripts/Effects/LetterSpacing.cs.meta diff --git a/Scripts/Effects/MonoSpacing.cs b/Runtime/Scripts/Effects/MonoSpacing.cs similarity index 99% rename from Scripts/Effects/MonoSpacing.cs rename to Runtime/Scripts/Effects/MonoSpacing.cs index 4b7dc0e..5bd4927 100644 --- a/Scripts/Effects/MonoSpacing.cs +++ b/Runtime/Scripts/Effects/MonoSpacing.cs @@ -15,7 +15,7 @@ rather primitive, but I can't see any better way at the moment. It means that all sorts of things can break the effect... This component should be placed higher in component list than any other vertex -modifiers that alter the total number of vertices. Eg, place this above Shadow +modifiers that alter the total number of vertices. EG, place this above Shadow or Outline effects. If you don't, the outline/shadow won't match the position of the letters properly. If you place the outline/shadow effect second however, it will just work on the altered vertices from this component, and function diff --git a/Scripts/Effects/MonoSpacing.cs.meta b/Runtime/Scripts/Effects/MonoSpacing.cs.meta similarity index 100% rename from Scripts/Effects/MonoSpacing.cs.meta rename to Runtime/Scripts/Effects/MonoSpacing.cs.meta diff --git a/Scripts/Effects/NicerOutline.cs b/Runtime/Scripts/Effects/NicerOutline.cs similarity index 100% rename from Scripts/Effects/NicerOutline.cs rename to Runtime/Scripts/Effects/NicerOutline.cs diff --git a/Scripts/Effects/NicerOutline.cs.meta b/Runtime/Scripts/Effects/NicerOutline.cs.meta similarity index 100% rename from Scripts/Effects/NicerOutline.cs.meta rename to Runtime/Scripts/Effects/NicerOutline.cs.meta diff --git a/Scripts/Effects/RaycastMask.cs b/Runtime/Scripts/Effects/RaycastMask.cs similarity index 100% rename from Scripts/Effects/RaycastMask.cs rename to Runtime/Scripts/Effects/RaycastMask.cs diff --git a/Scripts/Effects/RaycastMask.cs.meta b/Runtime/Scripts/Effects/RaycastMask.cs.meta similarity index 100% rename from Scripts/Effects/RaycastMask.cs.meta rename to Runtime/Scripts/Effects/RaycastMask.cs.meta diff --git a/Scripts/Effects/ShaderEffects.meta b/Runtime/Scripts/Effects/ShaderEffects.meta similarity index 100% rename from Scripts/Effects/ShaderEffects.meta rename to Runtime/Scripts/Effects/ShaderEffects.meta diff --git a/Scripts/Effects/ShaderEffects/UIAdditiveEffect.cs b/Runtime/Scripts/Effects/ShaderEffects/UIAdditiveEffect.cs similarity index 100% rename from Scripts/Effects/ShaderEffects/UIAdditiveEffect.cs rename to Runtime/Scripts/Effects/ShaderEffects/UIAdditiveEffect.cs diff --git a/Scripts/Effects/ShaderEffects/UIAdditiveEffect.cs.meta b/Runtime/Scripts/Effects/ShaderEffects/UIAdditiveEffect.cs.meta similarity index 100% rename from Scripts/Effects/ShaderEffects/UIAdditiveEffect.cs.meta rename to Runtime/Scripts/Effects/ShaderEffects/UIAdditiveEffect.cs.meta diff --git a/Scripts/Effects/ShaderEffects/UIImageCrop.cs b/Runtime/Scripts/Effects/ShaderEffects/UIImageCrop.cs similarity index 100% rename from Scripts/Effects/ShaderEffects/UIImageCrop.cs rename to Runtime/Scripts/Effects/ShaderEffects/UIImageCrop.cs diff --git a/Scripts/Effects/ShaderEffects/UIImageCrop.cs.meta b/Runtime/Scripts/Effects/ShaderEffects/UIImageCrop.cs.meta similarity index 100% rename from Scripts/Effects/ShaderEffects/UIImageCrop.cs.meta rename to Runtime/Scripts/Effects/ShaderEffects/UIImageCrop.cs.meta diff --git a/Scripts/Effects/ShaderEffects/UILinearDodgeEffect.cs b/Runtime/Scripts/Effects/ShaderEffects/UILinearDodgeEffect.cs similarity index 100% rename from Scripts/Effects/ShaderEffects/UILinearDodgeEffect.cs rename to Runtime/Scripts/Effects/ShaderEffects/UILinearDodgeEffect.cs diff --git a/Scripts/Effects/ShaderEffects/UILinearDodgeEffect.cs.meta b/Runtime/Scripts/Effects/ShaderEffects/UILinearDodgeEffect.cs.meta similarity index 100% rename from Scripts/Effects/ShaderEffects/UILinearDodgeEffect.cs.meta rename to Runtime/Scripts/Effects/ShaderEffects/UILinearDodgeEffect.cs.meta diff --git a/Scripts/Effects/ShaderEffects/UIMultiplyEffect.cs b/Runtime/Scripts/Effects/ShaderEffects/UIMultiplyEffect.cs similarity index 100% rename from Scripts/Effects/ShaderEffects/UIMultiplyEffect.cs rename to Runtime/Scripts/Effects/ShaderEffects/UIMultiplyEffect.cs diff --git a/Scripts/Effects/ShaderEffects/UIMultiplyEffect.cs.meta b/Runtime/Scripts/Effects/ShaderEffects/UIMultiplyEffect.cs.meta similarity index 100% rename from Scripts/Effects/ShaderEffects/UIMultiplyEffect.cs.meta rename to Runtime/Scripts/Effects/ShaderEffects/UIMultiplyEffect.cs.meta diff --git a/Scripts/Effects/ShaderEffects/UIScreenEffect.cs b/Runtime/Scripts/Effects/ShaderEffects/UIScreenEffect.cs similarity index 100% rename from Scripts/Effects/ShaderEffects/UIScreenEffect.cs rename to Runtime/Scripts/Effects/ShaderEffects/UIScreenEffect.cs diff --git a/Scripts/Effects/ShaderEffects/UIScreenEffect.cs.meta b/Runtime/Scripts/Effects/ShaderEffects/UIScreenEffect.cs.meta similarity index 100% rename from Scripts/Effects/ShaderEffects/UIScreenEffect.cs.meta rename to Runtime/Scripts/Effects/ShaderEffects/UIScreenEffect.cs.meta diff --git a/Scripts/Effects/ShaderEffects/UISoftAdditiveEffect.cs b/Runtime/Scripts/Effects/ShaderEffects/UISoftAdditiveEffect.cs similarity index 100% rename from Scripts/Effects/ShaderEffects/UISoftAdditiveEffect.cs rename to Runtime/Scripts/Effects/ShaderEffects/UISoftAdditiveEffect.cs diff --git a/Scripts/Effects/ShaderEffects/UISoftAdditiveEffect.cs.meta b/Runtime/Scripts/Effects/ShaderEffects/UISoftAdditiveEffect.cs.meta similarity index 100% rename from Scripts/Effects/ShaderEffects/UISoftAdditiveEffect.cs.meta rename to Runtime/Scripts/Effects/ShaderEffects/UISoftAdditiveEffect.cs.meta diff --git a/Scripts/Effects/ShineEffect.cs b/Runtime/Scripts/Effects/ShineEffect.cs similarity index 100% rename from Scripts/Effects/ShineEffect.cs rename to Runtime/Scripts/Effects/ShineEffect.cs diff --git a/Scripts/Effects/ShineEffect.cs.meta b/Runtime/Scripts/Effects/ShineEffect.cs.meta similarity index 100% rename from Scripts/Effects/ShineEffect.cs.meta rename to Runtime/Scripts/Effects/ShineEffect.cs.meta diff --git a/Scripts/Effects/ShineEffector.cs b/Runtime/Scripts/Effects/ShineEffector.cs similarity index 100% rename from Scripts/Effects/ShineEffector.cs rename to Runtime/Scripts/Effects/ShineEffector.cs diff --git a/Scripts/Effects/ShineEffector.cs.meta b/Runtime/Scripts/Effects/ShineEffector.cs.meta similarity index 100% rename from Scripts/Effects/ShineEffector.cs.meta rename to Runtime/Scripts/Effects/ShineEffector.cs.meta diff --git a/Scripts/Effects/SoftMaskScript.cs b/Runtime/Scripts/Effects/SoftMaskScript.cs similarity index 94% rename from Scripts/Effects/SoftMaskScript.cs rename to Runtime/Scripts/Effects/SoftMaskScript.cs index 893745e..999c35c 100644 --- a/Scripts/Effects/SoftMaskScript.cs +++ b/Runtime/Scripts/Effects/SoftMaskScript.cs @@ -1,6 +1,6 @@ /// Credit NemoKrad (aka Charles Humphrey) / valtain /// Sourced from - http://www.randomchaos.co.uk/SoftAlphaUIMask.aspx -/// Updated by valtain - https://bitbucket.org/ddreaper/unity-ui-extensions/pull-requests/33 +/// Updated by valtain - https://bitbucket.org/SimonDarksideJ/unity-ui-extensions/pull-requests/33 namespace UnityEngine.UI.Extensions { diff --git a/Scripts/Effects/SoftMaskScript.cs.meta b/Runtime/Scripts/Effects/SoftMaskScript.cs.meta similarity index 100% rename from Scripts/Effects/SoftMaskScript.cs.meta rename to Runtime/Scripts/Effects/SoftMaskScript.cs.meta diff --git a/Scripts/Effects/UIFlippable.cs b/Runtime/Scripts/Effects/UIFlippable.cs similarity index 100% rename from Scripts/Effects/UIFlippable.cs rename to Runtime/Scripts/Effects/UIFlippable.cs diff --git a/Scripts/Effects/UIFlippable.cs.meta b/Runtime/Scripts/Effects/UIFlippable.cs.meta similarity index 100% rename from Scripts/Effects/UIFlippable.cs.meta rename to Runtime/Scripts/Effects/UIFlippable.cs.meta diff --git a/Scripts/Effects/UIParticleSystem.cs b/Runtime/Scripts/Effects/UIParticleSystem.cs similarity index 99% rename from Scripts/Effects/UIParticleSystem.cs rename to Runtime/Scripts/Effects/UIParticleSystem.cs index f6705ab..95c3a0e 100644 --- a/Scripts/Effects/UIParticleSystem.cs +++ b/Runtime/Scripts/Effects/UIParticleSystem.cs @@ -1,6 +1,6 @@ /// Credit glennpow, Zarlang /// Sourced from - http://forum.unity3d.com/threads/free-script-particle-systems-in-ui-screen-space-overlay.406862/ -/// Updated by Zarlang with a more robust implementation, including TextureSheet annimation support +/// Updated by Zarlang with a more robust implementation, including TextureSheet animation support namespace UnityEngine.UI.Extensions { diff --git a/Scripts/Effects/UIParticleSystem.cs.meta b/Runtime/Scripts/Effects/UIParticleSystem.cs.meta similarity index 100% rename from Scripts/Effects/UIParticleSystem.cs.meta rename to Runtime/Scripts/Effects/UIParticleSystem.cs.meta diff --git a/Scripts/InputModules.meta b/Runtime/Scripts/InputModules.meta similarity index 100% rename from Scripts/InputModules.meta rename to Runtime/Scripts/InputModules.meta diff --git a/Scripts/InputModules/AimerInputModule.cs b/Runtime/Scripts/InputModules/AimerInputModule.cs similarity index 95% rename from Scripts/InputModules/AimerInputModule.cs rename to Runtime/Scripts/InputModules/AimerInputModule.cs index 199b656..d4ce670 100644 --- a/Scripts/InputModules/AimerInputModule.cs +++ b/Runtime/Scripts/InputModules/AimerInputModule.cs @@ -56,7 +56,7 @@ namespace UnityEngine.EventSystems.Extensions PointerEventData pointerData; //Not certain on the use of this. - //I know that -1 is the mouse and anything positive would be a finger/touch, 0 being the first finger, 1 beign the second and so one till the system limit is reached. + //I know that -1 is the mouse and anything positive would be a finger/touch, 0 being the first finger, 1 being the second and so one till the system limit is reached. //So that is the reason I choose -2. GetPointerData(-2, out pointerData, true); @@ -89,7 +89,7 @@ namespace UnityEngine.EventSystems.Extensions // handler to be what would receive a click. var newPressed = ExecuteEvents.ExecuteHierarchy(currentOverGo, pointer, ExecuteEvents.submitHandler); - // didnt find a press handler... search for a click handler + // didn't find a press handler... search for a click handler if (newPressed == null) { newPressed = ExecuteEvents.ExecuteHierarchy(currentOverGo, pointer, ExecuteEvents.pointerDownHandler); diff --git a/Scripts/InputModules/AimerInputModule.cs.meta b/Runtime/Scripts/InputModules/AimerInputModule.cs.meta similarity index 100% rename from Scripts/InputModules/AimerInputModule.cs.meta rename to Runtime/Scripts/InputModules/AimerInputModule.cs.meta diff --git a/Scripts/InputModules/GamePadInputModule.cs b/Runtime/Scripts/InputModules/GamePadInputModule.cs similarity index 95% rename from Scripts/InputModules/GamePadInputModule.cs rename to Runtime/Scripts/InputModules/GamePadInputModule.cs index 5e9d89e..d1d0d9b 100644 --- a/Scripts/InputModules/GamePadInputModule.cs +++ b/Runtime/Scripts/InputModules/GamePadInputModule.cs @@ -1,4 +1,4 @@ -/// Credit Simon (darkside) Jackson +/// Credit Simon (simonDarksideJ) Jackson /// Sourced from - UI SIM source and My Brain namespace UnityEngine.EventSystems @@ -193,7 +193,7 @@ namespace UnityEngine.EventSystems if (!allow) { // Otherwise, user held down key or axis. - // If direction didn't change at least 90 degrees, wait for delay before allowing consequtive event. + // If direction didn't change at least 90 degrees, wait for delay before allowing consecutive event. if (similarDir && m_ConsecutiveMoveCount == 1) allow = (time > m_PrevActionTime + m_RepeatDelay); // If direction changed at least 90 degree, or we already had the delay, repeat at repeat rate. diff --git a/Scripts/InputModules/GamePadInputModule.cs.meta b/Runtime/Scripts/InputModules/GamePadInputModule.cs.meta similarity index 100% rename from Scripts/InputModules/GamePadInputModule.cs.meta rename to Runtime/Scripts/InputModules/GamePadInputModule.cs.meta diff --git a/Scripts/Layout.meta b/Runtime/Scripts/Layout.meta similarity index 100% rename from Scripts/Layout.meta rename to Runtime/Scripts/Layout.meta diff --git a/Scripts/Layout/CardUI.meta b/Runtime/Scripts/Layout/CardUI.meta similarity index 100% rename from Scripts/Layout/CardUI.meta rename to Runtime/Scripts/Layout/CardUI.meta diff --git a/Scripts/Layout/CardUI/2D Cards.meta b/Runtime/Scripts/Layout/CardUI/2D Cards.meta similarity index 100% rename from Scripts/Layout/CardUI/2D Cards.meta rename to Runtime/Scripts/Layout/CardUI/2D Cards.meta diff --git a/Scripts/Layout/CardUI/2D Cards/CardExpanding2D.cs b/Runtime/Scripts/Layout/CardUI/2D Cards/CardExpanding2D.cs similarity index 100% rename from Scripts/Layout/CardUI/2D Cards/CardExpanding2D.cs rename to Runtime/Scripts/Layout/CardUI/2D Cards/CardExpanding2D.cs diff --git a/Scripts/Layout/CardUI/2D Cards/CardExpanding2D.cs.meta b/Runtime/Scripts/Layout/CardUI/2D Cards/CardExpanding2D.cs.meta similarity index 100% rename from Scripts/Layout/CardUI/2D Cards/CardExpanding2D.cs.meta rename to Runtime/Scripts/Layout/CardUI/2D Cards/CardExpanding2D.cs.meta diff --git a/Scripts/Layout/CardUI/2D Cards/CardPopup2D.cs b/Runtime/Scripts/Layout/CardUI/2D Cards/CardPopup2D.cs similarity index 100% rename from Scripts/Layout/CardUI/2D Cards/CardPopup2D.cs rename to Runtime/Scripts/Layout/CardUI/2D Cards/CardPopup2D.cs diff --git a/Scripts/Layout/CardUI/2D Cards/CardPopup2D.cs.meta b/Runtime/Scripts/Layout/CardUI/2D Cards/CardPopup2D.cs.meta similarity index 100% rename from Scripts/Layout/CardUI/2D Cards/CardPopup2D.cs.meta rename to Runtime/Scripts/Layout/CardUI/2D Cards/CardPopup2D.cs.meta diff --git a/Scripts/Layout/CardUI/2D Cards/CardStack2D.cs b/Runtime/Scripts/Layout/CardUI/2D Cards/CardStack2D.cs similarity index 99% rename from Scripts/Layout/CardUI/2D Cards/CardStack2D.cs rename to Runtime/Scripts/Layout/CardUI/2D Cards/CardStack2D.cs index b38059c..d099b6b 100644 --- a/Scripts/Layout/CardUI/2D Cards/CardStack2D.cs +++ b/Runtime/Scripts/Layout/CardUI/2D Cards/CardStack2D.cs @@ -41,7 +41,7 @@ public class CardStack2D : MonoBehaviour ///I wouldn't really recommend changing it, but go ahead if you want to. xPowerDifference = 9 - cards.Length; - ///This is optional, but makes it super easy to figure out the offscreen position for cards. + ///This is optional, but makes it super easy to figure out the off screen position for cards. ///Unfortunately, it's only really useful if the cards are the same width. if (useDefaultUsedXPos) { diff --git a/Scripts/Layout/CardUI/2D Cards/CardStack2D.cs.meta b/Runtime/Scripts/Layout/CardUI/2D Cards/CardStack2D.cs.meta similarity index 100% rename from Scripts/Layout/CardUI/2D Cards/CardStack2D.cs.meta rename to Runtime/Scripts/Layout/CardUI/2D Cards/CardStack2D.cs.meta diff --git a/Scripts/Layout/CardUI/3D Cards.meta b/Runtime/Scripts/Layout/CardUI/3D Cards.meta similarity index 100% rename from Scripts/Layout/CardUI/3D Cards.meta rename to Runtime/Scripts/Layout/CardUI/3D Cards.meta diff --git a/Scripts/Layout/CardUI/3D Cards/CardExpanding3D.cs b/Runtime/Scripts/Layout/CardUI/3D Cards/CardExpanding3D.cs similarity index 100% rename from Scripts/Layout/CardUI/3D Cards/CardExpanding3D.cs rename to Runtime/Scripts/Layout/CardUI/3D Cards/CardExpanding3D.cs diff --git a/Scripts/Layout/CardUI/3D Cards/CardExpanding3D.cs.meta b/Runtime/Scripts/Layout/CardUI/3D Cards/CardExpanding3D.cs.meta similarity index 100% rename from Scripts/Layout/CardUI/3D Cards/CardExpanding3D.cs.meta rename to Runtime/Scripts/Layout/CardUI/3D Cards/CardExpanding3D.cs.meta diff --git a/Scripts/Layout/CardUI/Superellipse Creation.meta b/Runtime/Scripts/Layout/CardUI/Superellipse Creation.meta similarity index 100% rename from Scripts/Layout/CardUI/Superellipse Creation.meta rename to Runtime/Scripts/Layout/CardUI/Superellipse Creation.meta diff --git a/Scripts/Layout/CardUI/Superellipse Creation/MeshCreator.cs b/Runtime/Scripts/Layout/CardUI/Superellipse Creation/MeshCreator.cs similarity index 100% rename from Scripts/Layout/CardUI/Superellipse Creation/MeshCreator.cs rename to Runtime/Scripts/Layout/CardUI/Superellipse Creation/MeshCreator.cs diff --git a/Scripts/Layout/CardUI/Superellipse Creation/MeshCreator.cs.meta b/Runtime/Scripts/Layout/CardUI/Superellipse Creation/MeshCreator.cs.meta similarity index 100% rename from Scripts/Layout/CardUI/Superellipse Creation/MeshCreator.cs.meta rename to Runtime/Scripts/Layout/CardUI/Superellipse Creation/MeshCreator.cs.meta diff --git a/Scripts/Layout/CardUI/Superellipse Creation/SuperellipsePoints.cs b/Runtime/Scripts/Layout/CardUI/Superellipse Creation/SuperellipsePoints.cs similarity index 100% rename from Scripts/Layout/CardUI/Superellipse Creation/SuperellipsePoints.cs rename to Runtime/Scripts/Layout/CardUI/Superellipse Creation/SuperellipsePoints.cs diff --git a/Scripts/Layout/CardUI/Superellipse Creation/SuperellipsePoints.cs.meta b/Runtime/Scripts/Layout/CardUI/Superellipse Creation/SuperellipsePoints.cs.meta similarity index 100% rename from Scripts/Layout/CardUI/Superellipse Creation/SuperellipsePoints.cs.meta rename to Runtime/Scripts/Layout/CardUI/Superellipse Creation/SuperellipsePoints.cs.meta diff --git a/Scripts/Layout/CardUI/Superellipse Creation/Triangulator.cs b/Runtime/Scripts/Layout/CardUI/Superellipse Creation/Triangulator.cs similarity index 100% rename from Scripts/Layout/CardUI/Superellipse Creation/Triangulator.cs rename to Runtime/Scripts/Layout/CardUI/Superellipse Creation/Triangulator.cs diff --git a/Scripts/Layout/CardUI/Superellipse Creation/Triangulator.cs.meta b/Runtime/Scripts/Layout/CardUI/Superellipse Creation/Triangulator.cs.meta similarity index 100% rename from Scripts/Layout/CardUI/Superellipse Creation/Triangulator.cs.meta rename to Runtime/Scripts/Layout/CardUI/Superellipse Creation/Triangulator.cs.meta diff --git a/Scripts/Layout/ContentScrollSnapHorizontal.cs b/Runtime/Scripts/Layout/ContentScrollSnapHorizontal.cs similarity index 98% rename from Scripts/Layout/ContentScrollSnapHorizontal.cs rename to Runtime/Scripts/Layout/ContentScrollSnapHorizontal.cs index 4e7ae27..7a65c69 100644 --- a/Scripts/Layout/ContentScrollSnapHorizontal.cs +++ b/Runtime/Scripts/Layout/ContentScrollSnapHorizontal.cs @@ -37,7 +37,7 @@ namespace UnityEngine.UI.Extensions [Header("Events")] [SerializeField] - [Tooltip("Event is triggered whenever the scroll rect starts to move, even when triggered programatically")] + [Tooltip("Event is triggered whenever the scroll rect starts to move, even when triggered programmatically")] private StartMovementEvent m_StartMovementEvent = new StartMovementEvent(); public StartMovementEvent MovementStarted { @@ -564,9 +564,9 @@ namespace UnityEngine.UI.Extensions public struct MoveInfo { public enum IndexType { childIndex, positionIndex } - [Tooltip("Child Index means the Index coresponds to the content item at that index in the hierarchy.\n" + + [Tooltip("Child Index means the Index corresponds to the content item at that index in the hierarchy.\n" + "Position Index means the Index corresponds to the content item in that snap position.\n" + - "A higher Position Index in a Horizonal Scroll Snap means it would be further to the right.")] + "A higher Position Index in a Horizontal Scroll Snap means it would be further to the right.")] public IndexType indexType; [Tooltip("Zero based")] public int index; diff --git a/Scripts/Layout/ContentScrollSnapHorizontal.cs.meta b/Runtime/Scripts/Layout/ContentScrollSnapHorizontal.cs.meta similarity index 100% rename from Scripts/Layout/ContentScrollSnapHorizontal.cs.meta rename to Runtime/Scripts/Layout/ContentScrollSnapHorizontal.cs.meta diff --git a/Scripts/Layout/CurvedLayout.cs b/Runtime/Scripts/Layout/CurvedLayout.cs similarity index 99% rename from Scripts/Layout/CurvedLayout.cs rename to Runtime/Scripts/Layout/CurvedLayout.cs index a02e9fc..fdc3637 100644 --- a/Scripts/Layout/CurvedLayout.cs +++ b/Runtime/Scripts/Layout/CurvedLayout.cs @@ -25,7 +25,7 @@ namespace UnityEngine.UI.Extensions [Tooltip("size of each item along the Normalized axis")] public float itemSize; - // the slope can be moved by altering this setting, it could be constrained to the 0-1 range, but other values are usefull for animations + // the slope can be moved by altering this setting, it could be constrained to the 0-1 range, but other values are useful for animations public float centerpoint = 0.5f; protected override void OnEnable() { base.OnEnable(); CalculateRadial(); } diff --git a/Scripts/Layout/CurvedLayout.cs.meta b/Runtime/Scripts/Layout/CurvedLayout.cs.meta similarity index 100% rename from Scripts/Layout/CurvedLayout.cs.meta rename to Runtime/Scripts/Layout/CurvedLayout.cs.meta diff --git a/Scripts/Layout/FancyScrollView.meta b/Runtime/Scripts/Layout/FancyScrollView.meta similarity index 100% rename from Scripts/Layout/FancyScrollView.meta rename to Runtime/Scripts/Layout/FancyScrollView.meta diff --git a/Scripts/Layout/FancyScrollView/Core.meta b/Runtime/Scripts/Layout/FancyScrollView/Core.meta similarity index 100% rename from Scripts/Layout/FancyScrollView/Core.meta rename to Runtime/Scripts/Layout/FancyScrollView/Core.meta diff --git a/Scripts/Layout/FancyScrollView/Core/FancyScrollViewCell.cs b/Runtime/Scripts/Layout/FancyScrollView/Core/FancyCell.cs similarity index 75% rename from Scripts/Layout/FancyScrollView/Core/FancyScrollViewCell.cs rename to Runtime/Scripts/Layout/FancyScrollView/Core/FancyCell.cs index 676a9a7..17928d1 100644 --- a/Scripts/Layout/FancyScrollView/Core/FancyScrollViewCell.cs +++ b/Runtime/Scripts/Layout/FancyScrollView/Core/FancyCell.cs @@ -1,16 +1,17 @@ /// Credit setchi (https://github.com/setchi) /// Sourced from - https://github.com/setchi/FancyScrollView + namespace UnityEngine.UI.Extensions { /// <summary> /// <see cref="FancyScrollView{TItemData, TContext}"/> のセルを実装するための抽象基底クラス. - /// <see cref="FancyScrollViewCell{TItemData, TContext}.Context"/> が不要な場合は - /// 代わりに <see cref="FancyScrollViewCell{TItemData}"/> を使用します. + /// <see cref="FancyCell{TItemData, TContext}.Context"/> が不要な場合は + /// 代わりに <see cref="FancyCell{TItemData}"/> を使用します. /// </summary> /// <typeparam name="TItemData">アイテムのデータ型.</typeparam> /// <typeparam name="TContext"><see cref="Context"/> の型.</typeparam> - public abstract class FancyScrollViewCell<TItemData, TContext> : MonoBehaviour where TContext : class, new() + public abstract class FancyCell<TItemData, TContext> : MonoBehaviour where TContext : class, new() { /// <summary> /// このセルで表示しているデータのインデックス. @@ -29,10 +30,15 @@ namespace UnityEngine.UI.Extensions protected TContext Context { get; private set; } /// <summary> - /// <see cref="Context"/> のセットアップを行います. + /// <see cref="Context"/> をセットします. /// </summary> /// <param name="context">コンテキスト.</param> - public virtual void SetupContext(TContext context) => Context = context; + public virtual void SetContext(TContext context) => Context = context; + + /// <summary> + /// 初期化を行います. + /// </summary> + public virtual void Initialize() { } /// <summary> /// このセルの可視状態を設定します. @@ -57,10 +63,10 @@ namespace UnityEngine.UI.Extensions /// <see cref="FancyScrollView{TItemData}"/> のセルを実装するための抽象基底クラス. /// </summary> /// <typeparam name="TItemData">アイテムのデータ型.</typeparam> - /// <seealso cref="FancyScrollViewCell{TItemData, TContext}"/> - public abstract class FancyScrollViewCell<TItemData> : FancyScrollViewCell<TItemData, FancyScrollViewNullContext> + /// <seealso cref="FancyCell{TItemData, TContext}"/> + public abstract class FancyCell<TItemData> : FancyCell<TItemData, NullContext> { /// <inheritdoc/> - public sealed override void SetupContext(FancyScrollViewNullContext context) => base.SetupContext(context); + public sealed override void SetContext(NullContext context) => base.SetContext(context); } } \ No newline at end of file diff --git a/Scripts/Layout/FancyScrollView/Core/FancyScrollViewCell.cs.meta b/Runtime/Scripts/Layout/FancyScrollView/Core/FancyCell.cs.meta similarity index 100% rename from Scripts/Layout/FancyScrollView/Core/FancyScrollViewCell.cs.meta rename to Runtime/Scripts/Layout/FancyScrollView/Core/FancyCell.cs.meta diff --git a/Scripts/Layout/FancyScrollView/Core/FancyScrollView.cs b/Runtime/Scripts/Layout/FancyScrollView/Core/FancyScrollView.cs similarity index 89% rename from Scripts/Layout/FancyScrollView/Core/FancyScrollView.cs rename to Runtime/Scripts/Layout/FancyScrollView/Core/FancyScrollView.cs index a225142..df3f942 100644 --- a/Scripts/Layout/FancyScrollView/Core/FancyScrollView.cs +++ b/Runtime/Scripts/Layout/FancyScrollView/Core/FancyScrollView.cs @@ -42,8 +42,7 @@ namespace UnityEngine.UI.Extensions /// </summary> [SerializeField] protected Transform cellContainer = default; - readonly IList<FancyScrollViewCell<TItemData, TContext>> pool = - new List<FancyScrollViewCell<TItemData, TContext>>(); + readonly IList<FancyCell<TItemData, TContext>> pool = new List<FancyCell<TItemData, TContext>>(); /// <summary> /// 初期化済みかどうか. @@ -90,7 +89,12 @@ namespace UnityEngine.UI.Extensions } /// <summary> - /// セルの表示内容を更新します. + /// セルのレイアウトを強制的に更新します. + /// </summary> + protected virtual void Relayout() => UpdatePosition(currentPosition, false); + + /// <summary> + /// セルのレイアウトと表示内容を強制的に更新します. /// </summary> protected virtual void Refresh() => UpdatePosition(currentPosition, true); @@ -130,16 +134,16 @@ namespace UnityEngine.UI.Extensions var addCount = Mathf.CeilToInt((1f - firstPosition) / cellInterval) - pool.Count; for (var i = 0; i < addCount; i++) { - var cell = Instantiate(CellPrefab, cellContainer) - .GetComponent<FancyScrollViewCell<TItemData, TContext>>(); + var cell = Instantiate(CellPrefab, cellContainer).GetComponent<FancyCell<TItemData, TContext>>(); if (cell == null) { - throw new MissingComponentException( - $"FancyScrollViewCell<{typeof(TItemData).FullName}, {typeof(TContext).FullName}> " + - $"component not found in {CellPrefab.name}."); + throw new MissingComponentException(string.Format( + "FancyCell<{0}, {1}> component not found in {2}.", + typeof(TItemData).FullName, typeof(TContext).FullName, CellPrefab.name)); } - cell.SetupContext(Context); + cell.SetContext(Context); + cell.Initialize(); cell.SetVisible(false); pool.Add(cell); } @@ -200,7 +204,7 @@ namespace UnityEngine.UI.Extensions /// <summary> /// <see cref="FancyScrollView{TItemData}"/> のコンテキストクラス. /// </summary> - public sealed class FancyScrollViewNullContext { } + public sealed class NullContext { } /// <summary> /// スクロールビューを実装するための抽象基底クラス. @@ -208,5 +212,5 @@ namespace UnityEngine.UI.Extensions /// </summary> /// <typeparam name="TItemData"></typeparam> /// <seealso cref="FancyScrollView{TItemData, TContext}"/> - public abstract class FancyScrollView<TItemData> : FancyScrollView<TItemData, FancyScrollViewNullContext> { } + public abstract class FancyScrollView<TItemData> : FancyScrollView<TItemData, NullContext> { } } \ No newline at end of file diff --git a/Scripts/Layout/FancyScrollView/Core/FancyScrollView.cs.meta b/Runtime/Scripts/Layout/FancyScrollView/Core/FancyScrollView.cs.meta similarity index 100% rename from Scripts/Layout/FancyScrollView/Core/FancyScrollView.cs.meta rename to Runtime/Scripts/Layout/FancyScrollView/Core/FancyScrollView.cs.meta diff --git a/Scripts/Layout/FancyScrollView/GridView.meta b/Runtime/Scripts/Layout/FancyScrollView/GridView.meta similarity index 100% rename from Scripts/Layout/FancyScrollView/GridView.meta rename to Runtime/Scripts/Layout/FancyScrollView/GridView.meta diff --git a/Runtime/Scripts/Layout/FancyScrollView/GridView/FancyCellGroup.cs b/Runtime/Scripts/Layout/FancyScrollView/GridView/FancyCellGroup.cs new file mode 100644 index 0000000..5aa3698 --- /dev/null +++ b/Runtime/Scripts/Layout/FancyScrollView/GridView/FancyCellGroup.cs @@ -0,0 +1,72 @@ +/// Credit setchi (https://github.com/setchi) +/// Sourced from - https://github.com/setchi/FancyScrollView + +using System.Linq; + +namespace UnityEngine.UI.Extensions +{ + /// <summary> + /// 複数の <see cref="FancyCell{TItemData, TContext}"/> を持つセルグループ実装するための抽象基底クラス. + /// </summary> + /// <typeparam name="TItemData">アイテムのデータ型.</typeparam> + /// <typeparam name="TContext"><see cref="FancyCell{TItemData, TContext}.Context"/> の型.</typeparam> + public abstract class FancyCellGroup<TItemData, TContext> : FancyCell<TItemData[], TContext> + where TContext : class, IFancyCellGroupContext, new() + { + /// <summary> + /// このグループで表示するセルの配列. + /// </summary> + protected virtual FancyCell<TItemData, TContext>[] Cells { get; private set; } + + /// <summary> + /// このグループで表示するセルの配列をインスタンス化します. + /// </summary> + /// <returns>このグループで表示するセルの配列.</returns> + protected virtual FancyCell<TItemData, TContext>[] InstantiateCells() + { + return Enumerable.Range(0, Context.GetGroupCount()) + .Select(_ => Instantiate(Context.CellTemplate, transform)) + .Select(x => x.GetComponent<FancyCell<TItemData, TContext>>()) + .ToArray(); + } + + /// <inheritdoc/> + public override void Initialize() + { + Cells = InstantiateCells(); + Debug.Assert(Cells.Length == Context.GetGroupCount()); + + for (var i = 0; i < Cells.Length; i++) + { + Cells[i].SetContext(Context); + Cells[i].Initialize(); + } + } + + /// <inheritdoc/> + public override void UpdateContent(TItemData[] contents) + { + var firstCellIndex = Index * Context.GetGroupCount(); + + for (var i = 0; i < Cells.Length; i++) + { + Cells[i].Index = i + firstCellIndex; + Cells[i].SetVisible(i < contents.Length); + + if (Cells[i].IsVisible) + { + Cells[i].UpdateContent(contents[i]); + } + } + } + + /// <inheritdoc/> + public override void UpdatePosition(float position) + { + for (var i = 0; i < Cells.Length; i++) + { + Cells[i].UpdatePosition(position); + } + } + } +} \ No newline at end of file diff --git a/Scripts/Layout/FancyScrollView/GridView/FancyGridViewRow.cs.meta b/Runtime/Scripts/Layout/FancyScrollView/GridView/FancyCellGroup.cs.meta similarity index 83% rename from Scripts/Layout/FancyScrollView/GridView/FancyGridViewRow.cs.meta rename to Runtime/Scripts/Layout/FancyScrollView/GridView/FancyCellGroup.cs.meta index dbcb384..65a825d 100644 --- a/Scripts/Layout/FancyScrollView/GridView/FancyGridViewRow.cs.meta +++ b/Runtime/Scripts/Layout/FancyScrollView/GridView/FancyCellGroup.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 84300901ad8704c11b39587ed6d87468 +guid: 5d97e25c7748b8d44acd2298e509c8f1 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Runtime/Scripts/Layout/FancyScrollView/GridView/FancyGridView.cs b/Runtime/Scripts/Layout/FancyScrollView/GridView/FancyGridView.cs new file mode 100644 index 0000000..4e1417b --- /dev/null +++ b/Runtime/Scripts/Layout/FancyScrollView/GridView/FancyGridView.cs @@ -0,0 +1,181 @@ +/// Credit setchi (https://github.com/setchi) +/// Sourced from - https://github.com/setchi/FancyScrollView + +using System; +using System.Collections.Generic; +using System.Linq; +using UnityEngine.UI.Extensions.EasingCore; + +namespace UnityEngine.UI.Extensions +{ + /// <summary> + /// グリッドレイアウトのスクロールビューを実装するための抽象基底クラス. + /// 無限スクロールおよびスナップには対応していません. + /// <see cref="FancyScrollView{TItemData, TContext}.Context"/> が不要な場合は + /// 代わりに <see cref="FancyGridView{TItemData}"/> を使用します. + /// </summary> + /// <typeparam name="TItemData">アイテムのデータ型.</typeparam> + /// <typeparam name="TContext"><see cref="FancyScrollView{TItemData, TContext}.Context"/> の型.</typeparam> + public abstract class FancyGridView<TItemData, TContext> : FancyScrollRect<TItemData[], TContext> + where TContext : class, IFancyGridViewContext, new() + { + /// <summary> + /// デフォルトのセルグループクラス. + /// </summary> + protected abstract class DefaultCellGroup : FancyCellGroup<TItemData, TContext> { } + + /// <summary> + /// 最初にセルを配置する軸方向のセル同士の余白. + /// </summary> + [SerializeField] protected float startAxisSpacing = 0f; + + /// <summary> + /// 最初にセルを配置する軸方向のセル数. + /// </summary> + [SerializeField] protected int startAxisCellCount = 4; + + /// <summary> + /// セルのサイズ. + /// </summary> + [SerializeField] protected Vector2 cellSize = new Vector2(100f, 100f); + + /// <summary> + /// セルのグループ Prefab. + /// </summary> + /// <remarks> + /// <see cref="FancyGridView{TItemData, TContext}"/> では, + /// <see cref="FancyScrollView{TItemData, TContext}.CellPrefab"/> を最初にセルを配置する軸方向のセルコンテナとして使用します. + /// </remarks> + protected sealed override GameObject CellPrefab => cellGroupTemplate; + + /// <inheritdoc/> + protected override float CellSize => Scroller.ScrollDirection == ScrollDirection.Horizontal + ? cellSize.x + : cellSize.y; + + /// <summary> + /// アイテムの総数. + /// </summary> + public int DataCount { get; private set; } + + GameObject cellGroupTemplate; + + /// <inheritdoc/> + protected override void Initialize() + { + base.Initialize(); + + Debug.Assert(startAxisCellCount > 0); + + Context.ScrollDirection = Scroller.ScrollDirection; + Context.GetGroupCount = () => startAxisCellCount; + Context.GetStartAxisSpacing = () => startAxisSpacing; + Context.GetCellSize = () => Scroller.ScrollDirection == ScrollDirection.Horizontal + ? cellSize.y + : cellSize.x; + + SetupCellTemplate(); + } + + /// <summary> + /// 最初にセルが生成される直前に呼び出されます. + /// <see cref="Setup{TGroup}(FancyCell{TItemData, TContext})"/> メソッドを使用してセルテンプレートのセットアップを行ってください. + /// </summary> + /// <example> + /// <code><![CDATA[ + /// using UnityEngine; + /// using FancyScrollView; + /// + /// public class MyGridView : FancyGridView<ItemData, Context> + /// { + /// class CellGroup : DefaultCellGroup { } + /// + /// [SerializeField] Cell cellPrefab = default; + /// + /// protected override void SetupCellTemplate() => Setup<CellGroup>(cellPrefab); + /// } + /// ]]></code> + /// </example> + protected abstract void SetupCellTemplate(); + + /// <summary> + /// セルテンプレートのセットアップを行います. + /// </summary> + /// <param name="cellTemplate">セルのテンプレート.</param> + /// <typeparam name="TGroup">セルグループの型.</typeparam> + protected virtual void Setup<TGroup>(FancyCell<TItemData, TContext> cellTemplate) + where TGroup : FancyCell<TItemData[], TContext> + { + Context.CellTemplate = cellTemplate.gameObject; + + cellGroupTemplate = new GameObject("Group").AddComponent<TGroup>().gameObject; + cellGroupTemplate.transform.SetParent(cellContainer, false); + cellGroupTemplate.SetActive(false); + } + + /// <summary> + /// 渡されたアイテム一覧に基づいて表示内容を更新します. + /// </summary> + /// <param name="items">アイテム一覧.</param> + public virtual void UpdateContents(IList<TItemData> items) + { + DataCount = items.Count; + + var itemGroups = items + .Select((item, index) => (item, index)) + .GroupBy( + x => x.index / startAxisCellCount, + x => x.item) + .Select(group => group.ToArray()) + .ToArray(); + + UpdateContents(itemGroups); + } + + /// <summary> + /// 指定したアイテムの位置までジャンプします. + /// </summary> + /// <param name="itemIndex">アイテムのインデックス.</param> + /// <param name="alignment">ビューポート内におけるセル位置の基準. 0f(先頭) ~ 1f(末尾).</param> + protected override void JumpTo(int itemIndex, float alignment = 0.5f) + { + var groupIndex = itemIndex / startAxisCellCount; + base.JumpTo(groupIndex, alignment); + } + + /// <summary> + /// 指定したアイテムの位置まで移動します. + /// </summary> + /// <param name="itemIndex">アイテムのインデックス.</param> + /// <param name="duration">移動にかける秒数.</param> + /// <param name="alignment">ビューポート内におけるセル位置の基準. 0f(先頭) ~ 1f(末尾).</param> + /// <param name="onComplete">移動が完了した際に呼び出されるコールバック.</param> + protected override void ScrollTo(int itemIndex, float duration, float alignment = 0.5f, Action onComplete = null) + { + var groupIndex = itemIndex / startAxisCellCount; + base.ScrollTo(groupIndex, duration, alignment, onComplete); + } + + /// <summary> + /// 指定したアイテムの位置まで移動します. + /// </summary> + /// <param name="itemIndex">アイテムのインデックス.</param> + /// <param name="duration">移動にかける秒数.</param> + /// <param name="easing">移動に使用するイージング.</param> + /// <param name="alignment">ビューポート内におけるセル位置の基準. 0f(先頭) ~ 1f(末尾).</param> + /// <param name="onComplete">移動が完了した際に呼び出されるコールバック.</param> + protected override void ScrollTo(int itemIndex, float duration, Ease easing, float alignment = 0.5f, Action onComplete = null) + { + var groupIndex = itemIndex / startAxisCellCount; + base.ScrollTo(groupIndex, duration, easing, alignment, onComplete); + } + } + + /// <summary> + /// グリッドレイアウトのスクロールビューを実装するための抽象基底クラス. + /// 無限スクロールおよびスナップには対応していません. + /// </summary> + /// <typeparam name="TItemData">アイテムのデータ型.</typeparam> + /// <seealso cref="FancyGridView{TItemData, TContext}"/> + public abstract class FancyGridView<TItemData> : FancyGridView<TItemData, FancyGridViewContext> { } +} \ No newline at end of file diff --git a/Scripts/Layout/FancyScrollView/GridView/FancyGridView.cs.meta b/Runtime/Scripts/Layout/FancyScrollView/GridView/FancyGridView.cs.meta similarity index 100% rename from Scripts/Layout/FancyScrollView/GridView/FancyGridView.cs.meta rename to Runtime/Scripts/Layout/FancyScrollView/GridView/FancyGridView.cs.meta diff --git a/Runtime/Scripts/Layout/FancyScrollView/GridView/FancyGridViewCell.cs b/Runtime/Scripts/Layout/FancyScrollView/GridView/FancyGridViewCell.cs new file mode 100644 index 0000000..0e78f0f --- /dev/null +++ b/Runtime/Scripts/Layout/FancyScrollView/GridView/FancyGridViewCell.cs @@ -0,0 +1,42 @@ +/// Credit setchi (https://github.com/setchi) +/// Sourced from - https://github.com/setchi/FancyScrollView + +namespace UnityEngine.UI.Extensions +{ + /// <summary> + /// <see cref="FancyGridView{TItemData, TContext}"/> のセルを実装するための抽象基底クラス. + /// <see cref="FancyCell{TItemData, TContext}.Context"/> が不要な場合は + /// 代わりに <see cref="FancyGridViewCell{TItemData}"/> を使用します. + /// </summary> + /// <typeparam name="TItemData">アイテムのデータ型.</typeparam> + /// <typeparam name="TContext"><see cref="FancyCell{TItemData, TContext}.Context"/> の型.</typeparam> + public abstract class FancyGridViewCell<TItemData, TContext> : FancyScrollRectCell<TItemData, TContext> + where TContext : class, IFancyGridViewContext, new() + { + /// <inheritdoc/> + protected override void UpdatePosition(float normalizedPosition, float localPosition) + { + var cellSize = Context.GetCellSize(); + var spacing = Context.GetStartAxisSpacing(); + var groupCount = Context.GetGroupCount(); + + var indexInGroup = Index % groupCount; + var positionInGroup = (cellSize + spacing) * (indexInGroup - (groupCount - 1) * 0.5f); + + transform.localPosition = Context.ScrollDirection == ScrollDirection.Horizontal + ? new Vector2(-localPosition, -positionInGroup) + : new Vector2(positionInGroup, localPosition); + } + } + + /// <summary> + /// <see cref="FancyGridView{TItemData}"/> のセルを実装するための抽象基底クラス. + /// </summary> + /// <typeparam name="TItemData">アイテムのデータ型.</typeparam> + /// <seealso cref="FancyGridViewCell{TItemData, TContext}"/> + public abstract class FancyGridViewCell<TItemData> : FancyGridViewCell<TItemData, FancyGridViewContext> + { + /// <inheritdoc/> + public sealed override void SetContext(FancyGridViewContext context) => base.SetContext(context); + } +} \ No newline at end of file diff --git a/Scripts/Layout/FancyScrollView/ScrollRect/Alignment.cs.meta b/Runtime/Scripts/Layout/FancyScrollView/GridView/FancyGridViewCell.cs.meta similarity index 83% rename from Scripts/Layout/FancyScrollView/ScrollRect/Alignment.cs.meta rename to Runtime/Scripts/Layout/FancyScrollView/GridView/FancyGridViewCell.cs.meta index 9c0ac48..8320c0a 100644 --- a/Scripts/Layout/FancyScrollView/ScrollRect/Alignment.cs.meta +++ b/Runtime/Scripts/Layout/FancyScrollView/GridView/FancyGridViewCell.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 3e786463ba934403cacf7e8c0d5822d7 +guid: ab8a59bbf5118824ab084e32342ad86b MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Scripts/Layout/FancyScrollView/GridView/FancyGridViewContext.cs b/Runtime/Scripts/Layout/FancyScrollView/GridView/FancyGridViewContext.cs similarity index 51% rename from Scripts/Layout/FancyScrollView/GridView/FancyGridViewContext.cs rename to Runtime/Scripts/Layout/FancyScrollView/GridView/FancyGridViewContext.cs index 05090c8..eb5de46 100644 --- a/Scripts/Layout/FancyScrollView/GridView/FancyGridViewContext.cs +++ b/Runtime/Scripts/Layout/FancyScrollView/GridView/FancyGridViewContext.cs @@ -8,16 +8,13 @@ namespace UnityEngine.UI.Extensions /// <summary> /// <see cref="FancyGridView{TItemData, TContext}"/> のコンテキスト基底クラス. /// </summary> - public class FancyGridViewContext : IFancyGridViewContext, IFancyScrollRectContext + public class FancyGridViewContext : IFancyGridViewContext { + ScrollDirection IFancyScrollRectContext.ScrollDirection { get; set; } Func<(float ScrollSize, float ReuseMargin)> IFancyScrollRectContext.CalculateScrollSize { get; set; } - - GameObject IFancyGridViewContext.CellTemplate { get; set; } - - ScrollDirection IFancyGridViewContext.ScrollDirection { get; set; } - - public Func<int> GetColumnCount { get; set; } - - public Func<float> GetColumnSpacing { get; set; } + GameObject IFancyCellGroupContext.CellTemplate { get; set; } + Func<int> IFancyCellGroupContext.GetGroupCount { get; set; } + Func<float> IFancyGridViewContext.GetStartAxisSpacing { get; set; } + Func<float> IFancyGridViewContext.GetCellSize { get; set; } } } \ No newline at end of file diff --git a/Scripts/Layout/FancyScrollView/GridView/FancyGridViewContext.cs.meta b/Runtime/Scripts/Layout/FancyScrollView/GridView/FancyGridViewContext.cs.meta similarity index 100% rename from Scripts/Layout/FancyScrollView/GridView/FancyGridViewContext.cs.meta rename to Runtime/Scripts/Layout/FancyScrollView/GridView/FancyGridViewContext.cs.meta diff --git a/Runtime/Scripts/Layout/FancyScrollView/GridView/IFancyCellGroupContext.cs b/Runtime/Scripts/Layout/FancyScrollView/GridView/IFancyCellGroupContext.cs new file mode 100644 index 0000000..07854ce --- /dev/null +++ b/Runtime/Scripts/Layout/FancyScrollView/GridView/IFancyCellGroupContext.cs @@ -0,0 +1,16 @@ +/// Credit setchi (https://github.com/setchi) +/// Sourced from - https://github.com/setchi/FancyScrollView + +using System; + +namespace UnityEngine.UI.Extensions +{ + /// <summary> + /// <see cref="FancyCellGroup{TItemData, TContext}"/> のコンテキストインターフェース. + /// </summary> + public interface IFancyCellGroupContext + { + GameObject CellTemplate { get; set; } + Func<int> GetGroupCount { get; set; } + } +} \ No newline at end of file diff --git a/Runtime/Scripts/Layout/FancyScrollView/GridView/IFancyCellGroupContext.cs.meta b/Runtime/Scripts/Layout/FancyScrollView/GridView/IFancyCellGroupContext.cs.meta new file mode 100644 index 0000000..1733d84 --- /dev/null +++ b/Runtime/Scripts/Layout/FancyScrollView/GridView/IFancyCellGroupContext.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1dc086f250206754aa8449e252d50388 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Scripts/Layout/FancyScrollView/GridView/IFancyGridViewContext.cs b/Runtime/Scripts/Layout/FancyScrollView/GridView/IFancyGridViewContext.cs similarity index 56% rename from Scripts/Layout/FancyScrollView/GridView/IFancyGridViewContext.cs rename to Runtime/Scripts/Layout/FancyScrollView/GridView/IFancyGridViewContext.cs index 70221da..33adb1b 100644 --- a/Scripts/Layout/FancyScrollView/GridView/IFancyGridViewContext.cs +++ b/Runtime/Scripts/Layout/FancyScrollView/GridView/IFancyGridViewContext.cs @@ -8,11 +8,9 @@ namespace UnityEngine.UI.Extensions /// <summary> /// <see cref="FancyGridView{TItemData, TContext}"/> のコンテキストインターフェース. /// </summary> - public interface IFancyGridViewContext + public interface IFancyGridViewContext : IFancyScrollRectContext, IFancyCellGroupContext { - GameObject CellTemplate { get; set; } - ScrollDirection ScrollDirection { get; set; } - Func<int> GetColumnCount { get; set; } - Func<float> GetColumnSpacing { get; set; } + Func<float> GetStartAxisSpacing { get; set; } + Func<float> GetCellSize { get; set ; } } } \ No newline at end of file diff --git a/Scripts/Layout/FancyScrollView/GridView/IFancyGridViewContext.cs.meta b/Runtime/Scripts/Layout/FancyScrollView/GridView/IFancyGridViewContext.cs.meta similarity index 100% rename from Scripts/Layout/FancyScrollView/GridView/IFancyGridViewContext.cs.meta rename to Runtime/Scripts/Layout/FancyScrollView/GridView/IFancyGridViewContext.cs.meta diff --git a/Scripts/Layout/FancyScrollView/ScrollRect.meta b/Runtime/Scripts/Layout/FancyScrollView/ScrollRect.meta similarity index 100% rename from Scripts/Layout/FancyScrollView/ScrollRect.meta rename to Runtime/Scripts/Layout/FancyScrollView/ScrollRect.meta diff --git a/Scripts/Layout/FancyScrollView/ScrollRect/FancyScrollRect.cs b/Runtime/Scripts/Layout/FancyScrollView/ScrollRect/FancyScrollRect.cs similarity index 86% rename from Scripts/Layout/FancyScrollView/ScrollRect/FancyScrollRect.cs rename to Runtime/Scripts/Layout/FancyScrollView/ScrollRect/FancyScrollRect.cs index 54b5a66..57ba6bb 100644 --- a/Scripts/Layout/FancyScrollView/ScrollRect/FancyScrollRect.cs +++ b/Runtime/Scripts/Layout/FancyScrollView/ScrollRect/FancyScrollRect.cs @@ -39,10 +39,15 @@ namespace UnityEngine.UI.Extensions [SerializeField] protected float paddingTail = 0f; /// <summary> - /// セル同士の余白. + /// スクロール軸方向のセル同士の余白. /// </summary> [SerializeField] protected float spacing = 0f; + /// <summary> + /// セルのサイズ. + /// </summary> + protected abstract float CellSize { get; } + /// <summary> /// スクロール可能かどうか. /// </summary> @@ -51,13 +56,6 @@ namespace UnityEngine.UI.Extensions /// </remarks> protected virtual bool Scrollable => MaxScrollPosition > 0f; - /// <summary> - /// セルのサイズ. - /// </summary> - protected virtual float CellSize => Scroller.ScrollDirection == ScrollDirection.Horizontal - ? CellRectTransform.rect.width - : CellRectTransform.rect.height; - Scroller cachedScroller; /// <summary> @@ -68,9 +66,6 @@ namespace UnityEngine.UI.Extensions /// </remarks> protected Scroller Scroller => cachedScroller ?? (cachedScroller = GetComponent<Scroller>()); - RectTransform cachedCellRect; - RectTransform CellRectTransform => cachedCellRect ?? (cachedCellRect = CellPrefab.transform as RectTransform); - float ScrollLength => 1f / Mathf.Max(cellInterval, 1e-2f) - 1f; float ViewportLength => ScrollLength - reuseCellMarginCount * 2f; @@ -87,6 +82,7 @@ namespace UnityEngine.UI.Extensions { base.Initialize(); + Context.ScrollDirection = Scroller.ScrollDirection; Context.CalculateScrollSize = () => { var interval = CellSize + spacing; @@ -138,6 +134,14 @@ namespace UnityEngine.UI.Extensions base.Refresh(); } + /// <inheritdoc/> + protected override void Relayout() + { + AdjustCellIntervalAndScrollOffset(); + RefreshScroller(); + base.Relayout(); + } + /// <summary> /// <see cref="Scroller"/> の各種状態を更新します. /// </summary> @@ -172,17 +176,17 @@ namespace UnityEngine.UI.Extensions /// <param name="position">スクロール位置.</param> protected new void UpdatePosition(float position) { - UpdatePosition(position, Alignment.Center); + Scroller.Position = ToScrollerPosition(position, 0.5f); } /// <summary> - /// スクロール位置を更新します. + /// 指定したアイテムの位置までジャンプします. /// </summary> - /// <param name="position">スクロール位置.</param> - /// <param name="alignment"><see cref="Alignment"/>.</param> - protected virtual void UpdatePosition(float position, Alignment alignment) + /// <param name="itemIndex">アイテムのインデックス.</param> + /// <param name="alignment">ビューポート内におけるセル位置の基準. 0f(先頭) ~ 1f(末尾).</param> + protected virtual void JumpTo(int itemIndex, float alignment = 0.5f) { - Scroller.Position = ToScrollerPosition(position, alignment); + Scroller.Position = ToScrollerPosition(itemIndex, alignment); } /// <summary> @@ -190,9 +194,9 @@ namespace UnityEngine.UI.Extensions /// </summary> /// <param name="index">アイテムのインデックス.</param> /// <param name="duration">移動にかける秒数.</param> - /// <param name="alignment"><see cref="Alignment"/>.</param> + /// <param name="alignment">ビューポート内におけるセル位置の基準. 0f(先頭) ~ 1f(末尾).</param> /// <param name="onComplete">移動が完了した際に呼び出されるコールバック.</param> - public virtual void ScrollTo(int index, float duration, Alignment alignment = Alignment.Center, Action onComplete = null) + protected virtual void ScrollTo(int index, float duration, float alignment = 0.5f, Action onComplete = null) { Scroller.ScrollTo(ToScrollerPosition(index, alignment), duration, onComplete); } @@ -203,9 +207,9 @@ namespace UnityEngine.UI.Extensions /// <param name="index">アイテムのインデックス.</param> /// <param name="duration">移動にかける秒数.</param> /// <param name="easing">移動に使用するイージング.</param> - /// <param name="alignment"><see cref="Alignment"/>.</param> + /// <param name="alignment">ビューポート内におけるセル位置の基準. 0f(先頭) ~ 1f(末尾).</param> /// <param name="onComplete">移動が完了した際に呼び出されるコールバック.</param> - public virtual void ScrollTo(int index, float duration, Ease easing, Alignment alignment = Alignment.Center, Action onComplete = null) + protected virtual void ScrollTo(int index, float duration, Ease easing, float alignment = 0.5f, Action onComplete = null) { Scroller.ScrollTo(ToScrollerPosition(index, alignment), duration, easing, onComplete); } @@ -244,25 +248,15 @@ namespace UnityEngine.UI.Extensions /// <see cref="FancyScrollRect{TItemData, TContext}"/> が扱うスクロール位置を <see cref="Scroller"/> が扱うスクロール位置に変換します. /// </summary> /// <param name="position"><see cref="FancyScrollRect{TItemData, TContext}"/> が扱うスクロール位置.</param> - /// <param name="alignment"><see cref="Alignment"/>.</param> + /// <param name="alignment">ビューポート内におけるセル位置の基準. 0f(先頭) ~ 1f(末尾).</param> /// <returns><see cref="Scroller"/> が扱うスクロール位置.</returns> - protected float ToScrollerPosition(float position, Alignment alignment = Alignment.Center) + protected float ToScrollerPosition(float position, float alignment = 0.5f) { - var offset = (ScrollLength - (1f + reuseCellMarginCount * 2f)) * GetAnchore(alignment); + var offset = alignment * (ScrollLength - (1f + reuseCellMarginCount * 2f)) + + (1f - alignment - 0.5f) * spacing / (CellSize + spacing); return ToScrollerPosition(Mathf.Clamp(position - offset, 0f, MaxScrollPosition)); } - float GetAnchore(Alignment alignment) - { - switch (alignment) - { - case Alignment.Head: return 0.0f; - case Alignment.Center: return 0.5f; - case Alignment.Tail: return 1.0f; - default: return GetAnchore(Alignment.Center); - } - } - /// <summary> /// 指定された設定を実現するための /// <see cref="FancyScrollView{TItemData,TContext}.cellInterval"/> と @@ -277,10 +271,7 @@ namespace UnityEngine.UI.Extensions protected virtual void OnValidate() { - if (CellPrefab) - { - AdjustCellIntervalAndScrollOffset(); - } + AdjustCellIntervalAndScrollOffset(); if (loop) { diff --git a/Scripts/Layout/FancyScrollView/ScrollRect/FancyScrollRect.cs.meta b/Runtime/Scripts/Layout/FancyScrollView/ScrollRect/FancyScrollRect.cs.meta similarity index 100% rename from Scripts/Layout/FancyScrollView/ScrollRect/FancyScrollRect.cs.meta rename to Runtime/Scripts/Layout/FancyScrollView/ScrollRect/FancyScrollRect.cs.meta diff --git a/Scripts/Layout/FancyScrollView/ScrollRect/FancyScrollRectCell.cs b/Runtime/Scripts/Layout/FancyScrollView/ScrollRect/FancyScrollRectCell.cs similarity index 63% rename from Scripts/Layout/FancyScrollView/ScrollRect/FancyScrollRectCell.cs rename to Runtime/Scripts/Layout/FancyScrollView/ScrollRect/FancyScrollRectCell.cs index 4e368c9..4b25d5b 100644 --- a/Scripts/Layout/FancyScrollView/ScrollRect/FancyScrollRectCell.cs +++ b/Runtime/Scripts/Layout/FancyScrollView/ScrollRect/FancyScrollRectCell.cs @@ -5,12 +5,12 @@ namespace UnityEngine.UI.Extensions { /// <summary> /// <see cref="FancyScrollRect{TItemData, TContext}"/> のセルを実装するための抽象基底クラス. - /// <see cref="FancyScrollViewCell{TItemData, TContext}.Context"/> が不要な場合は + /// <see cref="FancyCell{TItemData, TContext}.Context"/> が不要な場合は /// 代わりに <see cref="FancyScrollRectCell{TItemData}"/> を使用します. /// </summary> /// <typeparam name="TItemData">アイテムのデータ型.</typeparam> - /// <typeparam name="TContext"><see cref="FancyScrollViewCell{TItemData, TContext}.Context"/> の型.</typeparam> - public abstract class FancyScrollRectCell<TItemData, TContext> : FancyScrollViewCell<TItemData, TContext> + /// <typeparam name="TContext"><see cref="FancyCell{TItemData, TContext}.Context"/> の型.</typeparam> + public abstract class FancyScrollRectCell<TItemData, TContext> : FancyCell<TItemData, TContext> where TContext : class, IFancyScrollRectContext, new() { /// <inheritdoc/> @@ -18,24 +18,29 @@ namespace UnityEngine.UI.Extensions { var (scrollSize, reuseMargin) = Context.CalculateScrollSize(); - var unclampedPosition = (Mathf.Lerp(0f, scrollSize, position) - reuseMargin) / (scrollSize - reuseMargin * 2f); + var normalizedPosition = (Mathf.Lerp(0f, scrollSize, position) - reuseMargin) / (scrollSize - reuseMargin * 2f); var start = 0.5f * scrollSize; var end = -start; - UpdatePosition(unclampedPosition, Mathf.Lerp(start, end, position)); + UpdatePosition(normalizedPosition, Mathf.Lerp(start, end, position)); } /// <summary> /// このセルの位置を更新します. /// </summary> - /// <param name="position"> + /// <param name="normalizedPosition"> /// ビューポートの範囲で正規化されたスクロール位置. /// <see cref="FancyScrollRect{TItemData, TContext}.reuseCellMarginCount"/> の値に基づいて /// <c>0.0</c> ~ <c>1.0</c> の範囲を超えた値が渡されることがあります. /// </param> - /// <param name="viewportPosition">ローカル位置.</param> - protected virtual void UpdatePosition(float position, float viewportPosition) { } + /// <param name="localPosition">ローカル位置.</param> + protected virtual void UpdatePosition(float normalizedPosition, float localPosition) + { + transform.localPosition = Context.ScrollDirection == ScrollDirection.Horizontal + ? new Vector2(-localPosition, 0) + : new Vector2(0, localPosition); + } } /// <summary> @@ -46,6 +51,6 @@ namespace UnityEngine.UI.Extensions public abstract class FancyScrollRectCell<TItemData> : FancyScrollRectCell<TItemData, FancyScrollRectContext> { /// <inheritdoc/> - public sealed override void SetupContext(FancyScrollRectContext context) => base.SetupContext(context); + public sealed override void SetContext(FancyScrollRectContext context) => base.SetContext(context); } -} \ No newline at end of file +} diff --git a/Scripts/Layout/FancyScrollView/ScrollRect/FancyScrollRectCell.cs.meta b/Runtime/Scripts/Layout/FancyScrollView/ScrollRect/FancyScrollRectCell.cs.meta similarity index 100% rename from Scripts/Layout/FancyScrollView/ScrollRect/FancyScrollRectCell.cs.meta rename to Runtime/Scripts/Layout/FancyScrollView/ScrollRect/FancyScrollRectCell.cs.meta diff --git a/Scripts/Layout/FancyScrollView/ScrollRect/FancyScrollRectContext.cs b/Runtime/Scripts/Layout/FancyScrollView/ScrollRect/FancyScrollRectContext.cs similarity index 86% rename from Scripts/Layout/FancyScrollView/ScrollRect/FancyScrollRectContext.cs rename to Runtime/Scripts/Layout/FancyScrollView/ScrollRect/FancyScrollRectContext.cs index 17c113f..8b1b0c3 100644 --- a/Scripts/Layout/FancyScrollView/ScrollRect/FancyScrollRectContext.cs +++ b/Runtime/Scripts/Layout/FancyScrollView/ScrollRect/FancyScrollRectContext.cs @@ -10,6 +10,7 @@ namespace UnityEngine.UI.Extensions /// </summary> public class FancyScrollRectContext : IFancyScrollRectContext { + ScrollDirection IFancyScrollRectContext.ScrollDirection { get; set; } Func<(float ScrollSize, float ReuseMargin)> IFancyScrollRectContext.CalculateScrollSize { get; set; } } } \ No newline at end of file diff --git a/Scripts/Layout/FancyScrollView/ScrollRect/FancyScrollRectContext.cs.meta b/Runtime/Scripts/Layout/FancyScrollView/ScrollRect/FancyScrollRectContext.cs.meta similarity index 100% rename from Scripts/Layout/FancyScrollView/ScrollRect/FancyScrollRectContext.cs.meta rename to Runtime/Scripts/Layout/FancyScrollView/ScrollRect/FancyScrollRectContext.cs.meta diff --git a/Scripts/Layout/FancyScrollView/ScrollRect/IFancyScrollRectContext.cs b/Runtime/Scripts/Layout/FancyScrollView/ScrollRect/IFancyScrollRectContext.cs similarity index 89% rename from Scripts/Layout/FancyScrollView/ScrollRect/IFancyScrollRectContext.cs rename to Runtime/Scripts/Layout/FancyScrollView/ScrollRect/IFancyScrollRectContext.cs index 0a83479..e40396e 100644 --- a/Scripts/Layout/FancyScrollView/ScrollRect/IFancyScrollRectContext.cs +++ b/Runtime/Scripts/Layout/FancyScrollView/ScrollRect/IFancyScrollRectContext.cs @@ -10,6 +10,7 @@ namespace UnityEngine.UI.Extensions /// </summary> public interface IFancyScrollRectContext { + ScrollDirection ScrollDirection { get; set; } Func<(float ScrollSize, float ReuseMargin)> CalculateScrollSize { get; set; } } } \ No newline at end of file diff --git a/Scripts/Layout/FancyScrollView/ScrollRect/IFancyScrollRectContext.cs.meta b/Runtime/Scripts/Layout/FancyScrollView/ScrollRect/IFancyScrollRectContext.cs.meta similarity index 100% rename from Scripts/Layout/FancyScrollView/ScrollRect/IFancyScrollRectContext.cs.meta rename to Runtime/Scripts/Layout/FancyScrollView/ScrollRect/IFancyScrollRectContext.cs.meta diff --git a/Scripts/Layout/FancyScrollView/Scroller.meta b/Runtime/Scripts/Layout/FancyScrollView/Scroller.meta similarity index 100% rename from Scripts/Layout/FancyScrollView/Scroller.meta rename to Runtime/Scripts/Layout/FancyScrollView/Scroller.meta diff --git a/Scripts/Layout/FancyScrollView/Scroller/EasingCore.cs b/Runtime/Scripts/Layout/FancyScrollView/Scroller/EasingCore.cs similarity index 81% rename from Scripts/Layout/FancyScrollView/Scroller/EasingCore.cs rename to Runtime/Scripts/Layout/FancyScrollView/Scroller/EasingCore.cs index e6b1626..9828a81 100644 --- a/Scripts/Layout/FancyScrollView/Scroller/EasingCore.cs +++ b/Runtime/Scripts/Layout/FancyScrollView/Scroller/EasingCore.cs @@ -1,30 +1,8 @@ -// -// EasingCore - https://github.com/setchi/EasingCore -// -// The MIT License (MIT) -// -// Copyright (c) 2019 setchi -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -using System; -using UnityEngine; +/* + * EasingCore (https://github.com/setchi/EasingCore) + * Copyright (c) 2020 setchi + * Licensed under MIT (https://github.com/setchi/EasingCore/blob/master/LICENSE) + */ namespace UnityEngine.UI.Extensions.EasingCore { @@ -63,14 +41,16 @@ namespace UnityEngine.UI.Extensions.EasingCore InOutSine, } - public static class EasingFunction + public delegate float EasingFunction(float t); + + public static class Easing { /// <summary> /// Gets the easing function /// </summary> /// <param name="type">Ease type</param> /// <returns>Easing function</returns> - public static Func<float, float> Get(Ease type) + public static EasingFunction Get(Ease type) { switch (type) { @@ -170,7 +150,7 @@ namespace UnityEngine.UI.Extensions.EasingCore Mathf.Approximately(0.0f, v) || Mathf.Approximately(1.0f, v) ? v : v < 0.5f - ? 0.5f * Mathf.Pow(2f, (20f * v) - 10f) + ? 0.5f * Mathf.Pow(2f, (20f * v) - 10f) : -0.5f * Mathf.Pow(2f, (-20f * v) + 10f) + 1f; float inQuad(float t) => t * t; @@ -179,7 +159,7 @@ namespace UnityEngine.UI.Extensions.EasingCore float inOutQuad(float t) => t < 0.5f - ? 2f * t * t + ? 2f * t * t : -2f * t * t + 4f * t - 1f; float inQuart(float t) => t * t * t * t; diff --git a/Scripts/Layout/FancyScrollView/Scroller/EasingCore.cs.meta b/Runtime/Scripts/Layout/FancyScrollView/Scroller/EasingCore.cs.meta similarity index 100% rename from Scripts/Layout/FancyScrollView/Scroller/EasingCore.cs.meta rename to Runtime/Scripts/Layout/FancyScrollView/Scroller/EasingCore.cs.meta diff --git a/Scripts/Layout/FancyScrollView/Scroller/MovementDirection.cs b/Runtime/Scripts/Layout/FancyScrollView/Scroller/MovementDirection.cs similarity index 100% rename from Scripts/Layout/FancyScrollView/Scroller/MovementDirection.cs rename to Runtime/Scripts/Layout/FancyScrollView/Scroller/MovementDirection.cs diff --git a/Scripts/Layout/FancyScrollView/Scroller/MovementDirection.cs.meta b/Runtime/Scripts/Layout/FancyScrollView/Scroller/MovementDirection.cs.meta similarity index 100% rename from Scripts/Layout/FancyScrollView/Scroller/MovementDirection.cs.meta rename to Runtime/Scripts/Layout/FancyScrollView/Scroller/MovementDirection.cs.meta diff --git a/Scripts/Layout/FancyScrollView/Scroller/MovementType.cs b/Runtime/Scripts/Layout/FancyScrollView/Scroller/MovementType.cs similarity index 100% rename from Scripts/Layout/FancyScrollView/Scroller/MovementType.cs rename to Runtime/Scripts/Layout/FancyScrollView/Scroller/MovementType.cs diff --git a/Scripts/Layout/FancyScrollView/Scroller/MovementType.cs.meta b/Runtime/Scripts/Layout/FancyScrollView/Scroller/MovementType.cs.meta similarity index 100% rename from Scripts/Layout/FancyScrollView/Scroller/MovementType.cs.meta rename to Runtime/Scripts/Layout/FancyScrollView/Scroller/MovementType.cs.meta diff --git a/Scripts/Layout/FancyScrollView/Scroller/ScrollDirection.cs b/Runtime/Scripts/Layout/FancyScrollView/Scroller/ScrollDirection.cs similarity index 100% rename from Scripts/Layout/FancyScrollView/Scroller/ScrollDirection.cs rename to Runtime/Scripts/Layout/FancyScrollView/Scroller/ScrollDirection.cs diff --git a/Scripts/Layout/FancyScrollView/Scroller/ScrollDirection.cs.meta b/Runtime/Scripts/Layout/FancyScrollView/Scroller/ScrollDirection.cs.meta similarity index 100% rename from Scripts/Layout/FancyScrollView/Scroller/ScrollDirection.cs.meta rename to Runtime/Scripts/Layout/FancyScrollView/Scroller/ScrollDirection.cs.meta diff --git a/Scripts/Layout/FancyScrollView/Scroller/Scroller.cs b/Runtime/Scripts/Layout/FancyScrollView/Scroller/Scroller.cs similarity index 86% rename from Scripts/Layout/FancyScrollView/Scroller/Scroller.cs rename to Runtime/Scripts/Layout/FancyScrollView/Scroller/Scroller.cs index 262cabc..ea0c276 100644 --- a/Scripts/Layout/FancyScrollView/Scroller/Scroller.cs +++ b/Runtime/Scripts/Layout/FancyScrollView/Scroller/Scroller.cs @@ -10,7 +10,7 @@ namespace UnityEngine.UI.Extensions /// <summary> /// スクロール位置の制御を行うコンポーネント. /// </summary> - public class Scroller : UIBehaviour, IBeginDragHandler, IEndDragHandler, IDragHandler + public class Scroller : UIBehaviour, IPointerUpHandler, IPointerDownHandler, IBeginDragHandler, IEndDragHandler, IDragHandler, IScrollHandler { [SerializeField] RectTransform viewport = default; @@ -83,9 +83,7 @@ namespace UnityEngine.UI.Extensions set => decelerationRate = value; } - [SerializeField] - Snap snap = new Snap - { + [SerializeField] Snap snap = new Snap { Enable = true, VelocityThreshold = 0.5f, Duration = 0.3f, @@ -151,6 +149,8 @@ namespace UnityEngine.UI.Extensions int totalCount; + bool hold; + bool scrolling; bool dragging; float velocity; @@ -163,14 +163,14 @@ namespace UnityEngine.UI.Extensions public Ease Easing; } - static readonly Func<float, float> DefaultEasingFunction = EasingFunction.Get(Ease.OutCubic); + static readonly EasingFunction DefaultEasingFunction = Easing.Get(Ease.OutCubic); class AutoScrollState { public bool Enable; public bool Elastic; public float Duration; - public Func<float, float> EasingFunction; + public EasingFunction EasingFunction; public float StartTime; public float EndPosition; @@ -240,7 +240,7 @@ namespace UnityEngine.UI.Extensions /// <param name="duration">移動にかける秒数.</param> /// <param name="easing">移動に使用するイージング.</param> /// <param name="onComplete">移動が完了した際に呼び出されるコールバック.</param> - public void ScrollTo(float position, float duration, Ease easing, Action onComplete = null) => ScrollTo(position, duration, EasingFunction.Get(easing), onComplete); + public void ScrollTo(float position, float duration, Ease easing, Action onComplete = null) => ScrollTo(position, duration, Easing.Get(easing), onComplete); /// <summary> /// 指定した位置まで移動します. @@ -249,7 +249,7 @@ namespace UnityEngine.UI.Extensions /// <param name="duration">移動にかける秒数.</param> /// <param name="easingFunction">移動に使用するイージング関数.</param> /// <param name="onComplete">移動が完了した際に呼び出されるコールバック.</param> - public void ScrollTo(float position, float duration, Func<float, float> easingFunction, Action onComplete = null) + public void ScrollTo(float position, float duration, EasingFunction easingFunction, Action onComplete = null) { if (duration <= 0f) { @@ -283,13 +283,8 @@ namespace UnityEngine.UI.Extensions throw new ArgumentOutOfRangeException(nameof(index)); } - autoScrollState.Reset(); - - velocity = 0f; - dragging = false; - UpdateSelection(index); - UpdatePosition(index); + Position = index; } /// <summary> @@ -311,6 +306,75 @@ namespace UnityEngine.UI.Extensions : MovementDirection.Down; } + /// <inheritdoc/> + void IPointerDownHandler.OnPointerDown(PointerEventData eventData) + { + if (!draggable || eventData.button != PointerEventData.InputButton.Left) + { + return; + } + + hold = true; + velocity = 0f; + autoScrollState.Reset(); + } + + /// <inheritdoc/> + void IPointerUpHandler.OnPointerUp(PointerEventData eventData) + { + if (!draggable || eventData.button != PointerEventData.InputButton.Left) + { + return; + } + + if (hold && snap.Enable) + { + UpdateSelection(Mathf.Clamp(Mathf.RoundToInt(currentPosition), 0, totalCount - 1)); + ScrollTo(Mathf.RoundToInt(currentPosition), snap.Duration, snap.Easing); + } + + hold = false; + } + + /// <inheritdoc/> + void IScrollHandler.OnScroll(PointerEventData eventData) + { + if (!draggable) + { + return; + } + + var delta = eventData.scrollDelta; + + // Down is positive for scroll events, while in UI system up is positive. + delta.y *= -1; + var scrollDelta = scrollDirection == ScrollDirection.Horizontal + ? Mathf.Abs(delta.y) > Mathf.Abs(delta.x) + ? delta.y + : delta.x + : Mathf.Abs(delta.x) > Mathf.Abs(delta.y) + ? delta.x + : delta.y; + + if (eventData.IsScrolling()) + { + scrolling = true; + } + + var position = currentPosition + scrollDelta / ViewportSize * scrollSensitivity; + if (movementType == MovementType.Clamped) + { + position += CalculateOffset(position); + } + + if (autoScrollState.Enable) + { + autoScrollState.Reset(); + } + + UpdatePosition(position); + } + /// <inheritdoc/> void IBeginDragHandler.OnBeginDrag(PointerEventData eventData) { @@ -319,6 +383,7 @@ namespace UnityEngine.UI.Extensions return; } + hold = false; RectTransformUtility.ScreenPointToLocalPointInRectangle( viewport, eventData.position, @@ -449,7 +514,7 @@ namespace UnityEngine.UI.Extensions UpdatePosition(position); } - else if (!dragging && (!Mathf.Approximately(offset, 0f) || !Mathf.Approximately(velocity, 0f))) + else if (!(dragging || scrolling) && (!Mathf.Approximately(offset, 0f) || !Mathf.Approximately(velocity, 0f))) { var position = currentPosition; @@ -500,13 +565,14 @@ namespace UnityEngine.UI.Extensions } } - if (!autoScrollState.Enable && dragging && inertia) + if (!autoScrollState.Enable && (dragging || scrolling) && inertia) { var newVelocity = (currentPosition - prevPosition) / deltaTime; velocity = Mathf.Lerp(velocity, newVelocity, deltaTime * 10f); } prevPosition = currentPosition; + scrolling = false; } float CalculateMovementAmount(float sourcePosition, float destPosition) diff --git a/Scripts/Layout/FancyScrollView/Scroller/Scroller.cs.meta b/Runtime/Scripts/Layout/FancyScrollView/Scroller/Scroller.cs.meta similarity index 100% rename from Scripts/Layout/FancyScrollView/Scroller/Scroller.cs.meta rename to Runtime/Scripts/Layout/FancyScrollView/Scroller/Scroller.cs.meta diff --git a/Scripts/Layout/FlowLayoutGroup.cs b/Runtime/Scripts/Layout/FlowLayoutGroup.cs similarity index 96% rename from Scripts/Layout/FlowLayoutGroup.cs rename to Runtime/Scripts/Layout/FlowLayoutGroup.cs index 9cf1a28..bea7412 100644 --- a/Scripts/Layout/FlowLayoutGroup.cs +++ b/Runtime/Scripts/Layout/FlowLayoutGroup.cs @@ -2,7 +2,7 @@ /// Sourced from - http://forum.unity3d.com/threads/flowlayoutgroup.296709/ /// Example http://forum.unity3d.com/threads/flowlayoutgroup.296709/ /// Update by Martin Sharkbomb - http://forum.unity3d.com/threads/flowlayoutgroup.296709/#post-1977028 -/// Last item alignment fix by Vicente Russo - https://bitbucket.org/ddreaper/unity-ui-extensions/issues/22/flow-layout-group-align +/// Last item alignment fix by Vicente Russo - https://bitbucket.org/SimonDarksideJ/unity-ui-extensions/issues/22/flow-layout-group-align /// Vertical Flow by Ramon Molossi using System.Collections.Generic; diff --git a/Scripts/Layout/FlowLayoutGroup.cs.meta b/Runtime/Scripts/Layout/FlowLayoutGroup.cs.meta similarity index 100% rename from Scripts/Layout/FlowLayoutGroup.cs.meta rename to Runtime/Scripts/Layout/FlowLayoutGroup.cs.meta diff --git a/Scripts/Layout/HorizontalScrollSnap.cs b/Runtime/Scripts/Layout/HorizontalScrollSnap.cs similarity index 96% rename from Scripts/Layout/HorizontalScrollSnap.cs rename to Runtime/Scripts/Layout/HorizontalScrollSnap.cs index 457cb27..45a69cb 100644 --- a/Scripts/Layout/HorizontalScrollSnap.cs +++ b/Runtime/Scripts/Layout/HorizontalScrollSnap.cs @@ -1,6 +1,6 @@ /// Credit BinaryX /// Sourced from - http://forum.unity3d.com/threads/scripts-useful-4-6-scripts-collection.264161/page-2#post-1945602 -/// Updated by ddreaper - removed dependency on a custom ScrollRect script. Now implements drag interfaces and standard Scroll Rect. +/// Updated by SimonDarksideJ - removed dependency on a custom ScrollRect script. Now implements drag interfaces and standard Scroll Rect. using System; using UnityEngine.EventSystems; diff --git a/Scripts/Layout/HorizontalScrollSnap.cs.meta b/Runtime/Scripts/Layout/HorizontalScrollSnap.cs.meta similarity index 100% rename from Scripts/Layout/HorizontalScrollSnap.cs.meta rename to Runtime/Scripts/Layout/HorizontalScrollSnap.cs.meta diff --git a/Scripts/Layout/IScrollSnap.cs b/Runtime/Scripts/Layout/IScrollSnap.cs similarity index 100% rename from Scripts/Layout/IScrollSnap.cs rename to Runtime/Scripts/Layout/IScrollSnap.cs diff --git a/Scripts/Layout/IScrollSnap.cs.meta b/Runtime/Scripts/Layout/IScrollSnap.cs.meta similarity index 100% rename from Scripts/Layout/IScrollSnap.cs.meta rename to Runtime/Scripts/Layout/IScrollSnap.cs.meta diff --git a/Scripts/Layout/RadialLayout.cs b/Runtime/Scripts/Layout/RadialLayout.cs similarity index 93% rename from Scripts/Layout/RadialLayout.cs rename to Runtime/Scripts/Layout/RadialLayout.cs index e2a1fd0..e7b67f8 100644 --- a/Scripts/Layout/RadialLayout.cs +++ b/Runtime/Scripts/Layout/RadialLayout.cs @@ -1,8 +1,8 @@ /// Credit Danny Goodayle /// Sourced from - http://www.justapixel.co.uk/radial-layouts-nice-and-simple-in-unity3ds-ui-system/ -/// Updated by ddreaper - removed dependency on a custom ScrollRect script. Now implements drag interfaces and standard Scroll Rect. -/// Chid Layout fix by John Hattan - enables an options +/// Updated by SimonDarksideJ - removed dependency on a custom ScrollRect script. Now implements drag interfaces and standard Scroll Rect. +/// Child Layout fix by John Hattan - enables an options /* Radial Layout Group by Just a Pixel (Danny Goodayle) - http://www.justapixel.co.uk diff --git a/Scripts/Layout/RadialLayout.cs.meta b/Runtime/Scripts/Layout/RadialLayout.cs.meta similarity index 100% rename from Scripts/Layout/RadialLayout.cs.meta rename to Runtime/Scripts/Layout/RadialLayout.cs.meta diff --git a/Scripts/Layout/ScrollPositionController.cs b/Runtime/Scripts/Layout/ScrollPositionController.cs similarity index 100% rename from Scripts/Layout/ScrollPositionController.cs rename to Runtime/Scripts/Layout/ScrollPositionController.cs diff --git a/Scripts/Layout/ScrollPositionController.cs.meta b/Runtime/Scripts/Layout/ScrollPositionController.cs.meta similarity index 100% rename from Scripts/Layout/ScrollPositionController.cs.meta rename to Runtime/Scripts/Layout/ScrollPositionController.cs.meta diff --git a/Scripts/Layout/ScrollSnap.cs b/Runtime/Scripts/Layout/ScrollSnap.cs similarity index 96% rename from Scripts/Layout/ScrollSnap.cs rename to Runtime/Scripts/Layout/ScrollSnap.cs index b7f8b68..800d3ee 100644 --- a/Scripts/Layout/ScrollSnap.cs +++ b/Runtime/Scripts/Layout/ScrollSnap.cs @@ -1,6 +1,6 @@ /// Credit BinaryX /// Sourced from - http://forum.unity3d.com/threads/scripts-useful-4-6-scripts-collection.264161/page-2#post-1945602 -/// Updated by ddreaper - removed dependency on a custom ScrollRect script. Now implements drag interfaces and standard Scroll Rect. +/// Updated by simonDarksideJ - removed dependency on a custom ScrollRect script. Now implements drag interfaces and standard Scroll Rect. /// Update by xesenix - rewrote almost the entire code /// - configuration for direction move instead of 2 concurrent class (easier to change direction in editor) /// - supports list layout with horizontal or vertical layout need to match direction with type of layout used @@ -39,7 +39,7 @@ namespace UnityEngine.UI.Extensions private int _startingPage = 0; - // anchor points to lerp to to see child on certain indexes + // anchor points to lerp to see child on certain indexes private Vector3[] _pageAnchorPositions; private Vector3 _lerpTarget; diff --git a/Scripts/Layout/ScrollSnap.cs.meta b/Runtime/Scripts/Layout/ScrollSnap.cs.meta similarity index 100% rename from Scripts/Layout/ScrollSnap.cs.meta rename to Runtime/Scripts/Layout/ScrollSnap.cs.meta diff --git a/Scripts/Layout/ScrollSnapBase.cs b/Runtime/Scripts/Layout/ScrollSnapBase.cs similarity index 94% rename from Scripts/Layout/ScrollSnapBase.cs rename to Runtime/Scripts/Layout/ScrollSnapBase.cs index ac1f302..b8b3087 100644 --- a/Scripts/Layout/ScrollSnapBase.cs +++ b/Runtime/Scripts/Layout/ScrollSnapBase.cs @@ -1,6 +1,6 @@ /// Credit BinaryX /// Sourced from - http://forum.unity3d.com/threads/scripts-useful-4-6-scripts-collection.264161/page-2#post-1945602 -/// Updated by ddreaper - removed dependency on a custom ScrollRect script. Now implements drag interfaces and standard Scroll Rect. +/// Updated by simonDarksideJ - removed dependency on a custom ScrollRect script. Now implements drag interfaces and standard Scroll Rect. using System; using UnityEngine.Events; @@ -317,7 +317,14 @@ namespace UnityEngine.UI.Extensions if (!_lerp) StartScreenChange(); _lerp = true; - CurrentPage = _currentPage + 1; + if (_isInfinite) + { + CurrentPage = GetPageforPosition(_screensContainer.anchoredPosition) + 1; + } + else + { + CurrentPage = _currentPage + 1; + } GetPositionforPage(_currentPage, ref _lerp_target); ScreenChange(); } @@ -332,7 +339,14 @@ namespace UnityEngine.UI.Extensions if (!_lerp) StartScreenChange(); _lerp = true; - CurrentPage = _currentPage - 1; + if (_isInfinite) + { + CurrentPage = GetPageforPosition(_screensContainer.anchoredPosition) - 1; + } + else + { + CurrentPage = _currentPage - 1; + } GetPositionforPage(_currentPage, ref _lerp_target); ScreenChange(); } @@ -508,7 +522,7 @@ namespace UnityEngine.UI.Extensions var infiniteScroll = GetComponent<UI_InfiniteScroll>(); if (ChildObjects != null && ChildObjects.Length > 0 && infiniteScroll != null && !infiniteScroll.InitByUser) { - Debug.LogError("When using procedural children with a ScrollSnap (Adding Prefab ChildObjects) and the Infinite Scroll component\nYou must set the 'InitByUser' option to true, to enable late initialising"); + Debug.LogError($"[{gameObject.name}]When using procedural children with a ScrollSnap (Adding Prefab ChildObjects) and the Infinite Scroll component\nYou must set the 'InitByUser' option to true, to enable late initialising"); } } diff --git a/Scripts/Layout/ScrollSnapBase.cs.meta b/Runtime/Scripts/Layout/ScrollSnapBase.cs.meta similarity index 100% rename from Scripts/Layout/ScrollSnapBase.cs.meta rename to Runtime/Scripts/Layout/ScrollSnapBase.cs.meta diff --git a/Scripts/Layout/ScrollSnapScrollbarHelper.cs b/Runtime/Scripts/Layout/ScrollSnapScrollbarHelper.cs similarity index 94% rename from Scripts/Layout/ScrollSnapScrollbarHelper.cs rename to Runtime/Scripts/Layout/ScrollSnapScrollbarHelper.cs index 4cee355..e054c5d 100644 --- a/Scripts/Layout/ScrollSnapScrollbarHelper.cs +++ b/Runtime/Scripts/Layout/ScrollSnapScrollbarHelper.cs @@ -1,6 +1,6 @@ /// Credit Anonymous donation /// Sourced from - https://bitbucket.org/UnityUIExtensions/unity-ui-extensions/issues/120/horizontal-scroll-snap-scroll-bar-fix -/// Updated by ddreaper - Made extension support all types of scroll snap +/// Updated by simonDarksideJ - Made extension support all types of scroll snap using UnityEngine.EventSystems; diff --git a/Scripts/Layout/ScrollSnapScrollbarHelper.cs.meta b/Runtime/Scripts/Layout/ScrollSnapScrollbarHelper.cs.meta similarity index 100% rename from Scripts/Layout/ScrollSnapScrollbarHelper.cs.meta rename to Runtime/Scripts/Layout/ScrollSnapScrollbarHelper.cs.meta diff --git a/Scripts/Layout/TableLayoutGroup.cs b/Runtime/Scripts/Layout/TableLayoutGroup.cs similarity index 100% rename from Scripts/Layout/TableLayoutGroup.cs rename to Runtime/Scripts/Layout/TableLayoutGroup.cs diff --git a/Scripts/Layout/TableLayoutGroup.cs.meta b/Runtime/Scripts/Layout/TableLayoutGroup.cs.meta similarity index 100% rename from Scripts/Layout/TableLayoutGroup.cs.meta rename to Runtime/Scripts/Layout/TableLayoutGroup.cs.meta diff --git a/Scripts/Layout/TileSizeFitter.cs b/Runtime/Scripts/Layout/TileSizeFitter.cs similarity index 100% rename from Scripts/Layout/TileSizeFitter.cs rename to Runtime/Scripts/Layout/TileSizeFitter.cs diff --git a/Scripts/Layout/TileSizeFitter.cs.meta b/Runtime/Scripts/Layout/TileSizeFitter.cs.meta similarity index 100% rename from Scripts/Layout/TileSizeFitter.cs.meta rename to Runtime/Scripts/Layout/TileSizeFitter.cs.meta diff --git a/Scripts/Layout/UIVerticalScroller.cs b/Runtime/Scripts/Layout/UIVerticalScroller.cs similarity index 96% rename from Scripts/Layout/UIVerticalScroller.cs rename to Runtime/Scripts/Layout/UIVerticalScroller.cs index c3550ee..5d65dd5 100644 --- a/Scripts/Layout/UIVerticalScroller.cs +++ b/Runtime/Scripts/Layout/UIVerticalScroller.cs @@ -16,7 +16,7 @@ namespace UnityEngine.UI.Extensions public RectTransform center; [Tooltip("Size / spacing of elements")] public RectTransform elementSize; - [Tooltip("Scale = 1/ (1+distance fom center * shrinkage)")] + [Tooltip("Scale = 1/ (1+distance from center * shrinkage)")] public Vector2 elementShrinkage = new Vector2(1f / 200, 1f / 200); [Tooltip("Minimum element scale (furthest from center)")] public Vector2 minScale = new Vector2(0.7f, 0.7f); diff --git a/Scripts/Layout/UIVerticalScroller.cs.meta b/Runtime/Scripts/Layout/UIVerticalScroller.cs.meta similarity index 100% rename from Scripts/Layout/UIVerticalScroller.cs.meta rename to Runtime/Scripts/Layout/UIVerticalScroller.cs.meta diff --git a/Scripts/Layout/VerticalScrollSnap.cs b/Runtime/Scripts/Layout/VerticalScrollSnap.cs similarity index 100% rename from Scripts/Layout/VerticalScrollSnap.cs rename to Runtime/Scripts/Layout/VerticalScrollSnap.cs diff --git a/Scripts/Layout/VerticalScrollSnap.cs.meta b/Runtime/Scripts/Layout/VerticalScrollSnap.cs.meta similarity index 100% rename from Scripts/Layout/VerticalScrollSnap.cs.meta rename to Runtime/Scripts/Layout/VerticalScrollSnap.cs.meta diff --git a/Scripts/MenuSystem.meta b/Runtime/Scripts/MenuSystem.meta similarity index 100% rename from Scripts/MenuSystem.meta rename to Runtime/Scripts/MenuSystem.meta diff --git a/Scripts/MenuSystem/Menu.cs b/Runtime/Scripts/MenuSystem/Menu.cs similarity index 100% rename from Scripts/MenuSystem/Menu.cs rename to Runtime/Scripts/MenuSystem/Menu.cs diff --git a/Scripts/MenuSystem/Menu.cs.meta b/Runtime/Scripts/MenuSystem/Menu.cs.meta similarity index 100% rename from Scripts/MenuSystem/Menu.cs.meta rename to Runtime/Scripts/MenuSystem/Menu.cs.meta diff --git a/Scripts/MenuSystem/MenuManager.cs b/Runtime/Scripts/MenuSystem/MenuManager.cs similarity index 100% rename from Scripts/MenuSystem/MenuManager.cs rename to Runtime/Scripts/MenuSystem/MenuManager.cs diff --git a/Scripts/MenuSystem/MenuManager.cs.meta b/Runtime/Scripts/MenuSystem/MenuManager.cs.meta similarity index 100% rename from Scripts/MenuSystem/MenuManager.cs.meta rename to Runtime/Scripts/MenuSystem/MenuManager.cs.meta diff --git a/Scripts/MenuSystem/SimpleMenu.cs b/Runtime/Scripts/MenuSystem/SimpleMenu.cs similarity index 100% rename from Scripts/MenuSystem/SimpleMenu.cs rename to Runtime/Scripts/MenuSystem/SimpleMenu.cs diff --git a/Scripts/MenuSystem/SimpleMenu.cs.meta b/Runtime/Scripts/MenuSystem/SimpleMenu.cs.meta similarity index 100% rename from Scripts/MenuSystem/SimpleMenu.cs.meta rename to Runtime/Scripts/MenuSystem/SimpleMenu.cs.meta diff --git a/Scripts/Primitives.meta b/Runtime/Scripts/Primitives.meta similarity index 100% rename from Scripts/Primitives.meta rename to Runtime/Scripts/Primitives.meta diff --git a/Scripts/Primitives/DiamondGraph.cs b/Runtime/Scripts/Primitives/DiamondGraph.cs similarity index 100% rename from Scripts/Primitives/DiamondGraph.cs rename to Runtime/Scripts/Primitives/DiamondGraph.cs diff --git a/Scripts/Primitives/DiamondGraph.cs.meta b/Runtime/Scripts/Primitives/DiamondGraph.cs.meta similarity index 100% rename from Scripts/Primitives/DiamondGraph.cs.meta rename to Runtime/Scripts/Primitives/DiamondGraph.cs.meta diff --git a/Scripts/Primitives/UICircle.cs b/Runtime/Scripts/Primitives/UICircle.cs similarity index 96% rename from Scripts/Primitives/UICircle.cs rename to Runtime/Scripts/Primitives/UICircle.cs index 89106ec..8ebd609 100644 --- a/Scripts/Primitives/UICircle.cs +++ b/Runtime/Scripts/Primitives/UICircle.cs @@ -1,6 +1,6 @@ /// Credit zge, jeremie sellam /// Sourced from - http://forum.unity3d.com/threads/draw-circles-or-primitives-on-the-new-ui-canvas.272488/#post-2293224 -/// Updated from - https://bitbucket.org/ddreaper/unity-ui-extensions/issues/65/a-better-uicircle +/// Updated from - https://bitbucket.org/SimonDarksideJ/unity-ui-extensions/issues/65/a-better-uicircle /// Update 10.9.2017 (tswalker, https://bitbucket.org/tswalker/) /// diff --git a/Scripts/Primitives/UICircle.cs.meta b/Runtime/Scripts/Primitives/UICircle.cs.meta similarity index 100% rename from Scripts/Primitives/UICircle.cs.meta rename to Runtime/Scripts/Primitives/UICircle.cs.meta diff --git a/Scripts/Primitives/UICornerCut.cs b/Runtime/Scripts/Primitives/UICornerCut.cs similarity index 100% rename from Scripts/Primitives/UICornerCut.cs rename to Runtime/Scripts/Primitives/UICornerCut.cs diff --git a/Scripts/Primitives/UICornerCut.cs.meta b/Runtime/Scripts/Primitives/UICornerCut.cs.meta similarity index 100% rename from Scripts/Primitives/UICornerCut.cs.meta rename to Runtime/Scripts/Primitives/UICornerCut.cs.meta diff --git a/Scripts/Primitives/UIGridRenderer.cs b/Runtime/Scripts/Primitives/UIGridRenderer.cs similarity index 100% rename from Scripts/Primitives/UIGridRenderer.cs rename to Runtime/Scripts/Primitives/UIGridRenderer.cs diff --git a/Scripts/Primitives/UIGridRenderer.cs.meta b/Runtime/Scripts/Primitives/UIGridRenderer.cs.meta similarity index 100% rename from Scripts/Primitives/UIGridRenderer.cs.meta rename to Runtime/Scripts/Primitives/UIGridRenderer.cs.meta diff --git a/Scripts/Primitives/UILineRenderer.cs b/Runtime/Scripts/Primitives/UILineRenderer.cs similarity index 95% rename from Scripts/Primitives/UILineRenderer.cs rename to Runtime/Scripts/Primitives/UILineRenderer.cs index b6546a1..8698918 100644 --- a/Scripts/Primitives/UILineRenderer.cs +++ b/Runtime/Scripts/Primitives/UILineRenderer.cs @@ -160,7 +160,7 @@ namespace UnityEngine.UI.Extensions } if (BezierMode == BezierType.Catenary && pointsToDraw.Length == 2) { CableCurve cable = new CableCurve (pointsToDraw); - cable.slack = Resoloution; + cable.slack = Resolution; cable.steps = BezierSegmentsPerCurve; pointsToDraw = cable.Points (); } @@ -260,7 +260,7 @@ namespace UnityEngine.UI.Extensions vh.AddUIVertexQuad (segments [i]); } if (vh.currentVertCount > 64000) { - Debug.LogError ("Max Verticies size is 64000, current mesh vertcies count is [" + vh.currentVertCount + "] - Cannot Draw"); + Debug.LogError ("Max Verticies size is 64000, current mesh verticies count is [" + vh.currentVertCount + "] - Cannot Draw"); vh.Clear (); return; } @@ -399,7 +399,7 @@ namespace UnityEngine.UI.Extensions /// <remarks> /// Positive numbers should be used to specify Index and Segment /// </remarks> - /// <param name="index">Requied Index of the point, starting from point 1</param> + /// <param name="index">Required Index of the point, starting from point 1</param> /// <param name="segmentIndex">(optional) Required Segment the point is held in, Starting from Segment 1</param> /// <returns>Vector2 position of the point within UI Space</returns> public Vector2 GetPosition(int index, int segmentIndex = 0) @@ -435,7 +435,7 @@ namespace UnityEngine.UI.Extensions /// <summary> /// Get the Vector2 position of a line within a specific segment /// </summary> - /// <param name="index">Requied Index of the point, starting from point 1</param> + /// <param name="index">Required Index of the point, starting from point 1</param> /// <param name="segmentIndex"> Required Segment the point is held in, Starting from Segment 1</param> /// <returns>Vector2 position of the point within UI Space</returns> public Vector2 GetPositionBySegment(int index, int segment) @@ -446,7 +446,7 @@ namespace UnityEngine.UI.Extensions /// <summary> /// Get the closest point between two given Vector2s from a given Vector2 point /// </summary> - /// <param name="p1">Starting postion</param> + /// <param name="p1">Starting position</param> /// <param name="p2">End position</param> /// <param name="p3">Desired / Selected point</param> /// <returns>Closest Vector2 position of the target within UI Space</returns> diff --git a/Scripts/Primitives/UILineRenderer.cs.meta b/Runtime/Scripts/Primitives/UILineRenderer.cs.meta similarity index 100% rename from Scripts/Primitives/UILineRenderer.cs.meta rename to Runtime/Scripts/Primitives/UILineRenderer.cs.meta diff --git a/Scripts/Primitives/UILineRendererList.cs b/Runtime/Scripts/Primitives/UILineRendererList.cs similarity index 99% rename from Scripts/Primitives/UILineRendererList.cs rename to Runtime/Scripts/Primitives/UILineRendererList.cs index 1c48ca1..3927215 100644 --- a/Scripts/Primitives/UILineRendererList.cs +++ b/Runtime/Scripts/Primitives/UILineRendererList.cs @@ -179,7 +179,7 @@ namespace UnityEngine.UI.Extensions } if (BezierMode == BezierType.Catenary && pointsToDraw.Count == 2) { CableCurve cable = new CableCurve (pointsToDraw); - cable.slack = Resoloution; + cable.slack = Resolution; cable.steps = BezierSegmentsPerCurve; pointsToDraw.Clear(); pointsToDraw.AddRange(cable.Points()); @@ -282,7 +282,7 @@ namespace UnityEngine.UI.Extensions vh.AddUIVertexQuad (segments [i]); } if (vh.currentVertCount > 64000) { - Debug.LogError ("Max Verticies size is 64000, current mesh vertcies count is [" + vh.currentVertCount + "] - Cannot Draw"); + Debug.LogError ("Max Verticies size is 64000, current mesh verticies count is [" + vh.currentVertCount + "] - Cannot Draw"); vh.Clear (); return; } diff --git a/Scripts/Primitives/UILineRendererList.cs.meta b/Runtime/Scripts/Primitives/UILineRendererList.cs.meta similarity index 100% rename from Scripts/Primitives/UILineRendererList.cs.meta rename to Runtime/Scripts/Primitives/UILineRendererList.cs.meta diff --git a/Scripts/Primitives/UILineTextureRenderer.cs b/Runtime/Scripts/Primitives/UILineTextureRenderer.cs similarity index 100% rename from Scripts/Primitives/UILineTextureRenderer.cs rename to Runtime/Scripts/Primitives/UILineTextureRenderer.cs diff --git a/Scripts/Primitives/UILineTextureRenderer.cs.meta b/Runtime/Scripts/Primitives/UILineTextureRenderer.cs.meta similarity index 100% rename from Scripts/Primitives/UILineTextureRenderer.cs.meta rename to Runtime/Scripts/Primitives/UILineTextureRenderer.cs.meta diff --git a/Scripts/Primitives/UIPolygon.cs b/Runtime/Scripts/Primitives/UIPolygon.cs similarity index 100% rename from Scripts/Primitives/UIPolygon.cs rename to Runtime/Scripts/Primitives/UIPolygon.cs diff --git a/Scripts/Primitives/UIPolygon.cs.meta b/Runtime/Scripts/Primitives/UIPolygon.cs.meta similarity index 100% rename from Scripts/Primitives/UIPolygon.cs.meta rename to Runtime/Scripts/Primitives/UIPolygon.cs.meta diff --git a/Scripts/Primitives/UIPrimitiveBase.cs b/Runtime/Scripts/Primitives/UIPrimitiveBase.cs similarity index 95% rename from Scripts/Primitives/UIPrimitiveBase.cs rename to Runtime/Scripts/Primitives/UIPrimitiveBase.cs index 6096b54..e52823e 100644 --- a/Scripts/Primitives/UIPrimitiveBase.cs +++ b/Runtime/Scripts/Primitives/UIPrimitiveBase.cs @@ -34,7 +34,7 @@ namespace UnityEngine.UI.Extensions [SerializeField] protected float m_Resolution; - public float Resoloution { get { return m_Resolution; } set { m_Resolution = value; SetAllDirty(); } } + public float Resolution { get { return m_Resolution; } set { m_Resolution = value; SetAllDirty(); } } [SerializeField] private bool m_useNativeSize; @@ -287,7 +287,7 @@ namespace UnityEngine.UI.Extensions /// <summary> /// Return image adjusted position - /// **Copied from Unity's Image component for now and simplified for UI Extensions primatives + /// **Copied from Unity's Image component for now and simplified for UI Extensions primitives /// </summary> /// <param name="local"></param> /// <param name="rect"></param> @@ -335,7 +335,7 @@ namespace UnityEngine.UI.Extensions for (int axis = 0; axis <= 1; axis++) { // If the rect is smaller than the combined borders, then there's not room for the borders at their normal size. - // In order to avoid artefacts with overlapping borders, we scale the borders down to fit. + // In order to avoid artefact's with overlapping borders, we scale the borders down to fit. float combinedBorders = border[axis] + border[axis + 2]; if (rect.size[axis] < combinedBorders && combinedBorders != 0) { diff --git a/Scripts/Primitives/UIPrimitiveBase.cs.meta b/Runtime/Scripts/Primitives/UIPrimitiveBase.cs.meta similarity index 100% rename from Scripts/Primitives/UIPrimitiveBase.cs.meta rename to Runtime/Scripts/Primitives/UIPrimitiveBase.cs.meta diff --git a/Scripts/TabNavigationHelper.cs b/Runtime/Scripts/TabNavigationHelper.cs similarity index 100% rename from Scripts/TabNavigationHelper.cs rename to Runtime/Scripts/TabNavigationHelper.cs diff --git a/Scripts/TabNavigationHelper.cs.meta b/Runtime/Scripts/TabNavigationHelper.cs.meta similarity index 100% rename from Scripts/TabNavigationHelper.cs.meta rename to Runtime/Scripts/TabNavigationHelper.cs.meta diff --git a/Scripts/ToolTips.meta b/Runtime/Scripts/ToolTips.meta similarity index 100% rename from Scripts/ToolTips.meta rename to Runtime/Scripts/ToolTips.meta diff --git a/Scripts/ToolTips/BoundTooltip.meta b/Runtime/Scripts/ToolTips/BoundTooltip.meta similarity index 100% rename from Scripts/ToolTips/BoundTooltip.meta rename to Runtime/Scripts/ToolTips/BoundTooltip.meta diff --git a/Scripts/ToolTips/BoundTooltip/BoundTooltipItem.cs b/Runtime/Scripts/ToolTips/BoundTooltip/BoundTooltipItem.cs similarity index 100% rename from Scripts/ToolTips/BoundTooltip/BoundTooltipItem.cs rename to Runtime/Scripts/ToolTips/BoundTooltip/BoundTooltipItem.cs diff --git a/Scripts/ToolTips/BoundTooltip/BoundTooltipItem.cs.meta b/Runtime/Scripts/ToolTips/BoundTooltip/BoundTooltipItem.cs.meta similarity index 100% rename from Scripts/ToolTips/BoundTooltip/BoundTooltipItem.cs.meta rename to Runtime/Scripts/ToolTips/BoundTooltip/BoundTooltipItem.cs.meta diff --git a/Scripts/ToolTips/BoundTooltip/BoundTooltipTrigger.cs b/Runtime/Scripts/ToolTips/BoundTooltip/BoundTooltipTrigger.cs similarity index 100% rename from Scripts/ToolTips/BoundTooltip/BoundTooltipTrigger.cs rename to Runtime/Scripts/ToolTips/BoundTooltip/BoundTooltipTrigger.cs diff --git a/Scripts/ToolTips/BoundTooltip/BoundTooltipTrigger.cs.meta b/Runtime/Scripts/ToolTips/BoundTooltip/BoundTooltipTrigger.cs.meta similarity index 100% rename from Scripts/ToolTips/BoundTooltip/BoundTooltipTrigger.cs.meta rename to Runtime/Scripts/ToolTips/BoundTooltip/BoundTooltipTrigger.cs.meta diff --git a/Scripts/ToolTips/HoverTooltip.cs b/Runtime/Scripts/ToolTips/HoverTooltip.cs similarity index 96% rename from Scripts/ToolTips/HoverTooltip.cs rename to Runtime/Scripts/ToolTips/HoverTooltip.cs index ffc7b84..1eb29bf 100644 --- a/Scripts/ToolTips/HoverTooltip.cs +++ b/Runtime/Scripts/ToolTips/HoverTooltip.cs @@ -118,9 +118,7 @@ namespace UnityEngine.UI.Extensions OnScreenSpaceCamera(); } - - - //temporary call to don't fuck up old code, will be removed + //temporary call to not mess up old code, will be removed public void SetTooltip(string text, bool test) { NewTooltip(); @@ -136,7 +134,7 @@ namespace UnityEngine.UI.Extensions //position function, currently not working correctly due to the use of pivots and not manual offsets, soon to be fixed public void OnScreenSpaceCamera() { - //get the dynamic position of the pous in viewport coordinates + //get the dynamic position of the pos in viewport coordinates Vector3 newPos = GUICamera.ScreenToViewportPoint(Input.mousePosition); // store in val the updated position (x or y) of the tooltip edge of interest diff --git a/Scripts/ToolTips/HoverTooltip.cs.meta b/Runtime/Scripts/ToolTips/HoverTooltip.cs.meta similarity index 100% rename from Scripts/ToolTips/HoverTooltip.cs.meta rename to Runtime/Scripts/ToolTips/HoverTooltip.cs.meta diff --git a/Scripts/ToolTips/ToolTip.cs b/Runtime/Scripts/ToolTips/ToolTip.cs similarity index 95% rename from Scripts/ToolTips/ToolTip.cs rename to Runtime/Scripts/ToolTips/ToolTip.cs index 3d67cd3..01eae89 100644 --- a/Scripts/ToolTips/ToolTip.cs +++ b/Runtime/Scripts/ToolTips/ToolTip.cs @@ -1,6 +1,6 @@ /// Credit drHogan /// Sourced from - http://forum.unity3d.com/threads/screenspace-camera-tooltip-controller-sweat-and-tears.293991/#post-1938929 -/// updated ddreaper - refactored code to be more performant. +/// updated simonDarksideJ - refactored code to be more performant. /// updated lucasvinbr - mixed with BoundTooltip, should work with Screenspace Camera (non-rotated) and Overlay /// *Note - only works for non-rotated Screenspace Camera and Screenspace Overlay canvases at present, needs updating to include rotated Screenspace Camera and Worldspace! @@ -34,7 +34,7 @@ namespace UnityEngine.UI.Extensions public Canvas canvas; [Tooltip("Sets if tooltip triggers will run ForceUpdateCanvases and refresh the tooltip's layout group " + - "(if any) when hovered, in order to prevent momentaneous misplacement sometimes caused by ContentSizeFitters")] + "(if any) when hovered, in order to prevent momentousness misplacement sometimes caused by ContentSizeFitters")] public bool tooltipTriggersCanForceCanvasUpdate = false; /// <summary> diff --git a/Scripts/ToolTips/ToolTip.cs.meta b/Runtime/Scripts/ToolTips/ToolTip.cs.meta similarity index 100% rename from Scripts/ToolTips/ToolTip.cs.meta rename to Runtime/Scripts/ToolTips/ToolTip.cs.meta diff --git a/Scripts/ToolTips/TooltipTrigger.cs b/Runtime/Scripts/ToolTips/TooltipTrigger.cs similarity index 100% rename from Scripts/ToolTips/TooltipTrigger.cs rename to Runtime/Scripts/ToolTips/TooltipTrigger.cs diff --git a/Scripts/ToolTips/TooltipTrigger.cs.meta b/Runtime/Scripts/ToolTips/TooltipTrigger.cs.meta similarity index 100% rename from Scripts/ToolTips/TooltipTrigger.cs.meta rename to Runtime/Scripts/ToolTips/TooltipTrigger.cs.meta diff --git a/Scripts/UIWindowBase.cs b/Runtime/Scripts/UIWindowBase.cs similarity index 96% rename from Scripts/UIWindowBase.cs rename to Runtime/Scripts/UIWindowBase.cs index 2f06617..6a7065b 100644 --- a/Scripts/UIWindowBase.cs +++ b/Runtime/Scripts/UIWindowBase.cs @@ -57,7 +57,7 @@ namespace UnityEngine.UI.Extensions } } - //Note, the begin drag and end drag aren't actually needed to control the drag. However, I'd recommend keeping it in case you want to do somethind else when draggging starts and stops + //Note, the begin drag and end drag aren't actually needed to control the drag. However, I'd recommend keeping it in case you want to do something else when dragging starts and stops public void OnBeginDrag(PointerEventData eventData) { diff --git a/Scripts/UIWindowBase.cs.meta b/Runtime/Scripts/UIWindowBase.cs.meta similarity index 100% rename from Scripts/UIWindowBase.cs.meta rename to Runtime/Scripts/UIWindowBase.cs.meta diff --git a/Scripts/Utilities.meta b/Runtime/Scripts/Utilities.meta similarity index 100% rename from Scripts/Utilities.meta rename to Runtime/Scripts/Utilities.meta diff --git a/Scripts/Utilities/BezierPath.cs b/Runtime/Scripts/Utilities/BezierPath.cs similarity index 94% rename from Scripts/Utilities/BezierPath.cs rename to Runtime/Scripts/Utilities/BezierPath.cs index 03b8bde..61c7c7c 100644 --- a/Scripts/Utilities/BezierPath.cs +++ b/Runtime/Scripts/Utilities/BezierPath.cs @@ -170,12 +170,12 @@ namespace UnityEngine.UI.Extensions } /** - Caluclates a point on the path. + Calculates a point on the path. @param curveIndex The index of the curve that the point is on. For example, - the second curve (index 1) is the curve with controlpoints 3, 4, 5, and 6. + the second curve (index 1) is the curve with control points 3, 4, 5, and 6. - @param t The paramater indicating where on the curve the point is. 0 corresponds + @param t The parameter indicating where on the curve the point is. 0 corresponds to the "left" point, 1 corresponds to the "right" end point. */ public Vector2 CalculateBezierPoint(int curveIndex, float t) @@ -221,7 +221,7 @@ namespace UnityEngine.UI.Extensions Gets the drawing points. This implementation simply calculates a certain number of points per curve. - This is a lsightly different inplementation from the one above. + This is a slightly different implementation from the one above. */ public List<Vector2> GetDrawingPoints1() { @@ -327,7 +327,7 @@ namespace UnityEngine.UI.Extensions /** - Caluclates a point on the Bezier curve represented with the four controlpoints given. + Calculates a point on the Bezier curve represented with the four control points given. */ private Vector2 CalculateBezierPoint(float t, Vector2 p0, Vector2 p1, Vector2 p2, Vector2 p3) { diff --git a/Scripts/Utilities/BezierPath.cs.meta b/Runtime/Scripts/Utilities/BezierPath.cs.meta similarity index 100% rename from Scripts/Utilities/BezierPath.cs.meta rename to Runtime/Scripts/Utilities/BezierPath.cs.meta diff --git a/Scripts/Utilities/CLFZ2-CompressionHelper-ReadME.md b/Runtime/Scripts/Utilities/CLFZ2-CompressionHelper-ReadME.md similarity index 100% rename from Scripts/Utilities/CLFZ2-CompressionHelper-ReadME.md rename to Runtime/Scripts/Utilities/CLFZ2-CompressionHelper-ReadME.md diff --git a/Scripts/Utilities/CLFZ2-CompressionHelper-ReadME.md.meta b/Runtime/Scripts/Utilities/CLFZ2-CompressionHelper-ReadME.md.meta similarity index 100% rename from Scripts/Utilities/CLFZ2-CompressionHelper-ReadME.md.meta rename to Runtime/Scripts/Utilities/CLFZ2-CompressionHelper-ReadME.md.meta diff --git a/Scripts/Utilities/CLZF2.cs b/Runtime/Scripts/Utilities/CLZF2.cs similarity index 96% rename from Scripts/Utilities/CLZF2.cs rename to Runtime/Scripts/Utilities/CLZF2.cs index 196754a..d0ee049 100644 --- a/Scripts/Utilities/CLZF2.cs +++ b/Runtime/Scripts/Utilities/CLZF2.cs @@ -88,7 +88,7 @@ namespace UnityEngine.UI.Extensions { /// <summary> /// Improved C# LZF Compressor, a very small data compression library. The compression algorithm is extremely fast. - /// Note for strings, ensure you only use Unicode else specaial characters may get corrupted. + /// Note for strings, ensure you only use Unicode else special characters may get corrupted. public static class CLZF2 { private static readonly uint HLOG = 14; diff --git a/Scripts/Utilities/CLZF2.cs.meta b/Runtime/Scripts/Utilities/CLZF2.cs.meta similarity index 100% rename from Scripts/Utilities/CLZF2.cs.meta rename to Runtime/Scripts/Utilities/CLZF2.cs.meta diff --git a/Scripts/Utilities/CableCurve.cs b/Runtime/Scripts/Utilities/CableCurve.cs similarity index 100% rename from Scripts/Utilities/CableCurve.cs rename to Runtime/Scripts/Utilities/CableCurve.cs diff --git a/Scripts/Utilities/CableCurve.cs.meta b/Runtime/Scripts/Utilities/CableCurve.cs.meta similarity index 100% rename from Scripts/Utilities/CableCurve.cs.meta rename to Runtime/Scripts/Utilities/CableCurve.cs.meta diff --git a/Scripts/Utilities/Circle.cs b/Runtime/Scripts/Utilities/Circle.cs similarity index 100% rename from Scripts/Utilities/Circle.cs rename to Runtime/Scripts/Utilities/Circle.cs diff --git a/Scripts/Utilities/Circle.cs.meta b/Runtime/Scripts/Utilities/Circle.cs.meta similarity index 100% rename from Scripts/Utilities/Circle.cs.meta rename to Runtime/Scripts/Utilities/Circle.cs.meta diff --git a/Scripts/Utilities/DragCorrector.cs b/Runtime/Scripts/Utilities/DragCorrector.cs similarity index 100% rename from Scripts/Utilities/DragCorrector.cs rename to Runtime/Scripts/Utilities/DragCorrector.cs diff --git a/Scripts/Utilities/DragCorrector.cs.meta b/Runtime/Scripts/Utilities/DragCorrector.cs.meta similarity index 100% rename from Scripts/Utilities/DragCorrector.cs.meta rename to Runtime/Scripts/Utilities/DragCorrector.cs.meta diff --git a/Scripts/Utilities/ExtensionsToggle.cs b/Runtime/Scripts/Utilities/ExtensionsToggle.cs similarity index 100% rename from Scripts/Utilities/ExtensionsToggle.cs rename to Runtime/Scripts/Utilities/ExtensionsToggle.cs diff --git a/Scripts/Utilities/ExtensionsToggle.cs.meta b/Runtime/Scripts/Utilities/ExtensionsToggle.cs.meta similarity index 100% rename from Scripts/Utilities/ExtensionsToggle.cs.meta rename to Runtime/Scripts/Utilities/ExtensionsToggle.cs.meta diff --git a/Scripts/Utilities/ExtensionsToggleGroup.cs b/Runtime/Scripts/Utilities/ExtensionsToggleGroup.cs similarity index 100% rename from Scripts/Utilities/ExtensionsToggleGroup.cs rename to Runtime/Scripts/Utilities/ExtensionsToggleGroup.cs diff --git a/Scripts/Utilities/ExtensionsToggleGroup.cs.meta b/Runtime/Scripts/Utilities/ExtensionsToggleGroup.cs.meta similarity index 100% rename from Scripts/Utilities/ExtensionsToggleGroup.cs.meta rename to Runtime/Scripts/Utilities/ExtensionsToggleGroup.cs.meta diff --git a/Scripts/Utilities/ExtentionMethods.cs b/Runtime/Scripts/Utilities/ExtentionMethods.cs similarity index 100% rename from Scripts/Utilities/ExtentionMethods.cs rename to Runtime/Scripts/Utilities/ExtentionMethods.cs diff --git a/Scripts/Utilities/ExtentionMethods.cs.meta b/Runtime/Scripts/Utilities/ExtentionMethods.cs.meta similarity index 100% rename from Scripts/Utilities/ExtentionMethods.cs.meta rename to Runtime/Scripts/Utilities/ExtentionMethods.cs.meta diff --git a/Scripts/Utilities/InputFieldEnterSubmit.cs b/Runtime/Scripts/Utilities/InputFieldEnterSubmit.cs similarity index 88% rename from Scripts/Utilities/InputFieldEnterSubmit.cs rename to Runtime/Scripts/Utilities/InputFieldEnterSubmit.cs index d69d9ef..55d9bea 100644 --- a/Scripts/Utilities/InputFieldEnterSubmit.cs +++ b/Runtime/Scripts/Utilities/InputFieldEnterSubmit.cs @@ -1,5 +1,5 @@ /// Credit Vicente Russo -/// Sourced from - https://bitbucket.org/ddreaper/unity-ui-extensions/issues/23/returnkeytriggersbutton +/// Sourced from - https://bitbucket.org/SimonDarksideJ/unity-ui-extensions/issues/23/returnkeytriggersbutton using UnityEngine.Events; diff --git a/Scripts/Utilities/InputFieldEnterSubmit.cs.meta b/Runtime/Scripts/Utilities/InputFieldEnterSubmit.cs.meta similarity index 100% rename from Scripts/Utilities/InputFieldEnterSubmit.cs.meta rename to Runtime/Scripts/Utilities/InputFieldEnterSubmit.cs.meta diff --git a/Scripts/Utilities/NonDrawingGraphic.cs b/Runtime/Scripts/Utilities/NonDrawingGraphic.cs similarity index 100% rename from Scripts/Utilities/NonDrawingGraphic.cs rename to Runtime/Scripts/Utilities/NonDrawingGraphic.cs diff --git a/Scripts/Utilities/NonDrawingGraphic.cs.meta b/Runtime/Scripts/Utilities/NonDrawingGraphic.cs.meta similarity index 100% rename from Scripts/Utilities/NonDrawingGraphic.cs.meta rename to Runtime/Scripts/Utilities/NonDrawingGraphic.cs.meta diff --git a/Scripts/Utilities/PPIViewer.cs b/Runtime/Scripts/Utilities/PPIViewer.cs similarity index 91% rename from Scripts/Utilities/PPIViewer.cs rename to Runtime/Scripts/Utilities/PPIViewer.cs index 10523db..10541f0 100644 --- a/Scripts/Utilities/PPIViewer.cs +++ b/Runtime/Scripts/Utilities/PPIViewer.cs @@ -2,7 +2,7 @@ /// sourced from: http://answers.unity3d.com/questions/1149417/ui-button-onclick-sensitivity-for-high-dpi-devices.html#answer-1197307 /*USAGE: -Simply place the script on A Text control in the scene to display the current PPI / DPI of the sceen*/ +Simply place the script on A Text control in the scene to display the current PPI / DPI of the screen*/ namespace UnityEngine.UI.Extensions { diff --git a/Scripts/Utilities/PPIViewer.cs.meta b/Runtime/Scripts/Utilities/PPIViewer.cs.meta similarity index 100% rename from Scripts/Utilities/PPIViewer.cs.meta rename to Runtime/Scripts/Utilities/PPIViewer.cs.meta diff --git a/Scripts/Utilities/PaginationManager.cs b/Runtime/Scripts/Utilities/PaginationManager.cs similarity index 98% rename from Scripts/Utilities/PaginationManager.cs rename to Runtime/Scripts/Utilities/PaginationManager.cs index c85a280..79ca909 100644 --- a/Scripts/Utilities/PaginationManager.cs +++ b/Runtime/Scripts/Utilities/PaginationManager.cs @@ -36,7 +36,7 @@ namespace UnityEngine.UI.Extensions return; } - // dont want the scroll snap pagination + // do not want the scroll snap pagination if (scrollSnap.Pagination) scrollSnap.Pagination = null; @@ -63,7 +63,7 @@ namespace UnityEngine.UI.Extensions /// <summary> - /// Calling from other scripts if you need to change screens progamatically + /// Calling from other scripts if you need to change screens programmatically /// </summary> /// <param name="pageNo"></param> public void GoToScreen(int pageNo) diff --git a/Scripts/Utilities/PaginationManager.cs.meta b/Runtime/Scripts/Utilities/PaginationManager.cs.meta similarity index 100% rename from Scripts/Utilities/PaginationManager.cs.meta rename to Runtime/Scripts/Utilities/PaginationManager.cs.meta diff --git a/Scripts/Utilities/ReadOnlyAttribute.cs b/Runtime/Scripts/Utilities/ReadOnlyAttribute.cs similarity index 100% rename from Scripts/Utilities/ReadOnlyAttribute.cs rename to Runtime/Scripts/Utilities/ReadOnlyAttribute.cs diff --git a/Scripts/Utilities/ReadOnlyAttribute.cs.meta b/Runtime/Scripts/Utilities/ReadOnlyAttribute.cs.meta similarity index 100% rename from Scripts/Utilities/ReadOnlyAttribute.cs.meta rename to Runtime/Scripts/Utilities/ReadOnlyAttribute.cs.meta diff --git a/Scripts/Utilities/ReturnKeyTriggersButton.cs b/Runtime/Scripts/Utilities/ReturnKeyTriggersButton.cs similarity index 91% rename from Scripts/Utilities/ReturnKeyTriggersButton.cs rename to Runtime/Scripts/Utilities/ReturnKeyTriggersButton.cs index b1bdd22..db5a230 100644 --- a/Scripts/Utilities/ReturnKeyTriggersButton.cs +++ b/Runtime/Scripts/Utilities/ReturnKeyTriggersButton.cs @@ -1,6 +1,6 @@ /// Credit Melang /// Sourced from - http://forum.unity3d.com/members/melang.593409/ -/// Updated ddreaper - reworked to 4.6.1 standards +/// Updated SimonDarksideJ - reworked to 4.6.1 standards using UnityEngine.EventSystems; namespace UnityEngine.UI diff --git a/Scripts/Utilities/ReturnKeyTriggersButton.cs.meta b/Runtime/Scripts/Utilities/ReturnKeyTriggersButton.cs.meta similarity index 100% rename from Scripts/Utilities/ReturnKeyTriggersButton.cs.meta rename to Runtime/Scripts/Utilities/ReturnKeyTriggersButton.cs.meta diff --git a/Scripts/Utilities/ScrollConflictManager.cs b/Runtime/Scripts/Utilities/ScrollConflictManager.cs similarity index 90% rename from Scripts/Utilities/ScrollConflictManager.cs rename to Runtime/Scripts/Utilities/ScrollConflictManager.cs index 2c6bab3..c66788d 100644 --- a/Scripts/Utilities/ScrollConflictManager.cs +++ b/Runtime/Scripts/Utilities/ScrollConflictManager.cs @@ -1,12 +1,12 @@ /// Credit srinivas sunil -/// sourced from: https://bitbucket.org/ddreaper/unity-ui-extensions/pull-requests/21/develop_53/diff +/// sourced from: https://bitbucket.org/SimonDarksideJ/unity-ui-extensions/pull-requests/21/develop_53/diff /// Updated by Hiep Eldest : https://bitbucket.org/UnityUIExtensions/unity-ui-extensions/issues/300/scrollconflictmanager-not-working-if using UnityEngine.EventSystems; /// <summary> /// This is the most efficient way to handle scroll conflicts when there are multiple scroll rects, this is useful when there is a vertical scrollrect in/on a horizontal scrollrect or vice versa -/// Attach the script to the rect scroll and assign other rectscroll in the inspecter (one is verticle and other is horizontal) gathered and modified from unity answers(delta snipper) +/// Attach the script to the rect scroll and assign other rectscroll in the inspector (one is vertical and other is horizontal) gathered and modified from unity answers(delta snipper) /// </summary> namespace UnityEngine.UI.Extensions { @@ -26,7 +26,7 @@ namespace UnityEngine.UI.Extensions private IDragHandler[] _dragHandlers; //This tracks if the other one should be scrolling instead of the current one. private bool scrollOther; - //This tracks wether the other one should scroll horizontally or vertically. + //This tracks whether the other one should scroll horizontally or vertically. private bool scrollOtherHorizontally; void Awake() @@ -41,11 +41,11 @@ namespace UnityEngine.UI.Extensions if (_myScrollRect.horizontal) Debug.LogError("You have added the SecondScrollRect to a scroll view that already has both directions selected"); if (!ParentScrollRect.horizontal) - Debug.LogError("The other scroll rect doesnt support scrolling horizontally"); + Debug.LogError("The other scroll rect does not support scrolling horizontally"); } else if (!ParentScrollRect.vertical) { - Debug.LogError("The other scroll rect doesnt support scrolling vertically"); + Debug.LogError("The other scroll rect does not support scrolling vertically"); } if (ParentScrollRect && !ParentScrollSnap) @@ -73,7 +73,7 @@ namespace UnityEngine.UI.Extensions if (horizontal > vertical) { scrollOther = true; - //disable the current scroll rect so it doesnt move. + //disable the current scroll rect so it does not move. _myScrollRect.enabled = false; for (int i = 0, length = _beginDragHandlers.Length; i < length; i++) { @@ -85,7 +85,7 @@ namespace UnityEngine.UI.Extensions else if (vertical > horizontal) { scrollOther = true; - //disable the current scroll rect so it doesnt move. + //disable the current scroll rect so it does not move. _myScrollRect.enabled = false; for (int i = 0, length = _beginDragHandlers.Length; i < length; i++) { diff --git a/Scripts/Utilities/ScrollConflictManager.cs.meta b/Runtime/Scripts/Utilities/ScrollConflictManager.cs.meta similarity index 100% rename from Scripts/Utilities/ScrollConflictManager.cs.meta rename to Runtime/Scripts/Utilities/ScrollConflictManager.cs.meta diff --git a/Scripts/Utilities/ScrollRectEx.cs b/Runtime/Scripts/Utilities/ScrollRectEx.cs similarity index 96% rename from Scripts/Utilities/ScrollRectEx.cs rename to Runtime/Scripts/Utilities/ScrollRectEx.cs index 9795839..ccead1e 100644 --- a/Scripts/Utilities/ScrollRectEx.cs +++ b/Runtime/Scripts/Utilities/ScrollRectEx.cs @@ -3,7 +3,7 @@ /// sourced from: http://forum.unity3d.com/threads/scripts-useful-4-6-scripts-collection.264161/page-2#post-2011648 /*USAGE: -Simply place the script on the ScrollRect that contains the selectable children we'll be scroling to +Simply place the script on the ScrollRect that contains the selectable children we'll be scrolling to and drag'n'drop the RectTransform of the options "container" that we'll be scrolling.*/ using System; diff --git a/Scripts/Utilities/ScrollRectEx.cs.meta b/Runtime/Scripts/Utilities/ScrollRectEx.cs.meta similarity index 100% rename from Scripts/Utilities/ScrollRectEx.cs.meta rename to Runtime/Scripts/Utilities/ScrollRectEx.cs.meta diff --git a/Scripts/Utilities/ScrollRectExtensions.cs b/Runtime/Scripts/Utilities/ScrollRectExtensions.cs similarity index 100% rename from Scripts/Utilities/ScrollRectExtensions.cs rename to Runtime/Scripts/Utilities/ScrollRectExtensions.cs diff --git a/Scripts/Utilities/ScrollRectExtensions.cs.meta b/Runtime/Scripts/Utilities/ScrollRectExtensions.cs.meta similarity index 100% rename from Scripts/Utilities/ScrollRectExtensions.cs.meta rename to Runtime/Scripts/Utilities/ScrollRectExtensions.cs.meta diff --git a/Scripts/Utilities/ScrollRectLinker.cs b/Runtime/Scripts/Utilities/ScrollRectLinker.cs similarity index 100% rename from Scripts/Utilities/ScrollRectLinker.cs rename to Runtime/Scripts/Utilities/ScrollRectLinker.cs diff --git a/Scripts/Utilities/ScrollRectLinker.cs.meta b/Runtime/Scripts/Utilities/ScrollRectLinker.cs.meta similarity index 100% rename from Scripts/Utilities/ScrollRectLinker.cs.meta rename to Runtime/Scripts/Utilities/ScrollRectLinker.cs.meta diff --git a/Scripts/Utilities/ScrollRectTweener.cs b/Runtime/Scripts/Utilities/ScrollRectTweener.cs similarity index 100% rename from Scripts/Utilities/ScrollRectTweener.cs rename to Runtime/Scripts/Utilities/ScrollRectTweener.cs diff --git a/Scripts/Utilities/ScrollRectTweener.cs.meta b/Runtime/Scripts/Utilities/ScrollRectTweener.cs.meta similarity index 100% rename from Scripts/Utilities/ScrollRectTweener.cs.meta rename to Runtime/Scripts/Utilities/ScrollRectTweener.cs.meta diff --git a/Scripts/Utilities/SelectableScaler.cs b/Runtime/Scripts/Utilities/SelectableScaler.cs similarity index 100% rename from Scripts/Utilities/SelectableScaler.cs rename to Runtime/Scripts/Utilities/SelectableScaler.cs diff --git a/Scripts/Utilities/SelectableScaler.cs.meta b/Runtime/Scripts/Utilities/SelectableScaler.cs.meta similarity index 100% rename from Scripts/Utilities/SelectableScaler.cs.meta rename to Runtime/Scripts/Utilities/SelectableScaler.cs.meta diff --git a/Scripts/Utilities/SetPropertyUtility.cs b/Runtime/Scripts/Utilities/SetPropertyUtility.cs similarity index 100% rename from Scripts/Utilities/SetPropertyUtility.cs rename to Runtime/Scripts/Utilities/SetPropertyUtility.cs diff --git a/Scripts/Utilities/SetPropertyUtility.cs.meta b/Runtime/Scripts/Utilities/SetPropertyUtility.cs.meta similarity index 100% rename from Scripts/Utilities/SetPropertyUtility.cs.meta rename to Runtime/Scripts/Utilities/SetPropertyUtility.cs.meta diff --git a/Scripts/Utilities/TestCompression.cs b/Runtime/Scripts/Utilities/TestCompression.cs similarity index 100% rename from Scripts/Utilities/TestCompression.cs rename to Runtime/Scripts/Utilities/TestCompression.cs diff --git a/Scripts/Utilities/TestCompression.cs.meta b/Runtime/Scripts/Utilities/TestCompression.cs.meta similarity index 100% rename from Scripts/Utilities/TestCompression.cs.meta rename to Runtime/Scripts/Utilities/TestCompression.cs.meta diff --git a/Scripts/Utilities/UIExtensionMethods.cs b/Runtime/Scripts/Utilities/UIExtensionMethods.cs similarity index 97% rename from Scripts/Utilities/UIExtensionMethods.cs rename to Runtime/Scripts/Utilities/UIExtensionMethods.cs index e879a75..2b2f10a 100644 --- a/Scripts/Utilities/UIExtensionMethods.cs +++ b/Runtime/Scripts/Utilities/UIExtensionMethods.cs @@ -1,4 +1,4 @@ -/// Credit Simon (darkside) Jackson +/// Credit Simon (simonDarksideJ) Jackson /// Sourced from - My head namespace UnityEngine.UI.Extensions { diff --git a/Scripts/Utilities/UIExtensionMethods.cs.meta b/Runtime/Scripts/Utilities/UIExtensionMethods.cs.meta similarity index 100% rename from Scripts/Utilities/UIExtensionMethods.cs.meta rename to Runtime/Scripts/Utilities/UIExtensionMethods.cs.meta diff --git a/Scripts/Utilities/UIHighlightable.cs b/Runtime/Scripts/Utilities/UIHighlightable.cs similarity index 100% rename from Scripts/Utilities/UIHighlightable.cs rename to Runtime/Scripts/Utilities/UIHighlightable.cs diff --git a/Scripts/Utilities/UIHighlightable.cs.meta b/Runtime/Scripts/Utilities/UIHighlightable.cs.meta similarity index 100% rename from Scripts/Utilities/UIHighlightable.cs.meta rename to Runtime/Scripts/Utilities/UIHighlightable.cs.meta diff --git a/Scripts/Utilities/UILineConnector.cs b/Runtime/Scripts/Utilities/UILineConnector.cs similarity index 100% rename from Scripts/Utilities/UILineConnector.cs rename to Runtime/Scripts/Utilities/UILineConnector.cs diff --git a/Scripts/Utilities/UILineConnector.cs.meta b/Runtime/Scripts/Utilities/UILineConnector.cs.meta similarity index 100% rename from Scripts/Utilities/UILineConnector.cs.meta rename to Runtime/Scripts/Utilities/UILineConnector.cs.meta diff --git a/Scripts/Utilities/UIScrollToSelection.cs b/Runtime/Scripts/Utilities/UIScrollToSelection.cs similarity index 96% rename from Scripts/Utilities/UIScrollToSelection.cs rename to Runtime/Scripts/Utilities/UIScrollToSelection.cs index d258443..6eff1ae 100644 --- a/Scripts/Utilities/UIScrollToSelection.cs +++ b/Runtime/Scripts/Utilities/UIScrollToSelection.cs @@ -2,7 +2,7 @@ /// sourced from: http://forum.unity3d.com/threads/scripts-useful-4-6-scripts-collection.264161/page-2#post-2011648 /*USAGE: -Simply place the script on the ScrollRect that contains the selectable children we'll be scroling to +Simply place the script on the ScrollRect that contains the selectable children we'll be scrolling to and drag'n'drop the RectTransform of the options "container" that we'll be scrolling.*/ using System.Collections.Generic; diff --git a/Scripts/Utilities/UIScrollToSelection.cs.meta b/Runtime/Scripts/Utilities/UIScrollToSelection.cs.meta similarity index 100% rename from Scripts/Utilities/UIScrollToSelection.cs.meta rename to Runtime/Scripts/Utilities/UIScrollToSelection.cs.meta diff --git a/Scripts/Utilities/UIScrollToSelectionXY.cs b/Runtime/Scripts/Utilities/UIScrollToSelectionXY.cs similarity index 94% rename from Scripts/Utilities/UIScrollToSelectionXY.cs rename to Runtime/Scripts/Utilities/UIScrollToSelectionXY.cs index 1ca0208..2dcad7b 100644 --- a/Scripts/Utilities/UIScrollToSelectionXY.cs +++ b/Runtime/Scripts/Utilities/UIScrollToSelectionXY.cs @@ -4,7 +4,7 @@ /// you can restrict movement by locking axis on ScrollRect component /*USAGE: -Simply place the script on the ScrollRect that contains the selectable children we'll be scroling to +Simply place the script on the ScrollRect that contains the selectable children we'll be scrolling to and drag'n'drop the RectTransform of the options "container" that we'll be scrolling.*/ using UnityEngine.EventSystems; @@ -48,7 +48,7 @@ namespace UnityEngine.UI.Extensions private void ScrollRectToLevelSelection() { - // FIX: if you dont do that here events can have null value + // FIX: if you do not do that here events can have null value var events = EventSystem.current; // check main references diff --git a/Scripts/Utilities/UIScrollToSelectionXY.cs.meta b/Runtime/Scripts/Utilities/UIScrollToSelectionXY.cs.meta similarity index 100% rename from Scripts/Utilities/UIScrollToSelectionXY.cs.meta rename to Runtime/Scripts/Utilities/UIScrollToSelectionXY.cs.meta diff --git a/Scripts/Utilities/UISelectableExtension.cs b/Runtime/Scripts/Utilities/UISelectableExtension.cs similarity index 90% rename from Scripts/Utilities/UISelectableExtension.cs rename to Runtime/Scripts/Utilities/UISelectableExtension.cs index 155872d..8fcfb23 100644 --- a/Scripts/Utilities/UISelectableExtension.cs +++ b/Runtime/Scripts/Utilities/UISelectableExtension.cs @@ -1,6 +1,6 @@ /// Credit AriathTheWise, Sfyne /// Sourced from - http://forum.unity3d.com/threads/scripts-useful-4-6-scripts-collection.264161/page-2#post-1796783 -/// Additional disabled - https://bitbucket.org/ddreaper/unity-ui-extensions/issues/47/uiselectableextension-_pressed-bug +/// Additional disabled - https://bitbucket.org/SimonDarksideJ/unity-ui-extensions/issues/47/uiselectableextension-_pressed-bug /// Extended to include a HELD state that continually fires while the button is held down. /// Refactored so it can be added to any button and expose the events in the editor. @@ -81,7 +81,7 @@ namespace UnityEngine.UI.Extensions } /// <summary> - /// Test method to verify a controll is pressed + /// Test method to verify a control is pressed /// </summary> public void TestPressed() { diff --git a/Scripts/Utilities/UISelectableExtension.cs.meta b/Runtime/Scripts/Utilities/UISelectableExtension.cs.meta similarity index 100% rename from Scripts/Utilities/UISelectableExtension.cs.meta rename to Runtime/Scripts/Utilities/UISelectableExtension.cs.meta diff --git a/Scripts/Utilities/UI_InfiniteScroll.cs b/Runtime/Scripts/Utilities/UI_InfiniteScroll.cs similarity index 95% rename from Scripts/Utilities/UI_InfiniteScroll.cs rename to Runtime/Scripts/Utilities/UI_InfiniteScroll.cs index 27fb439..dde85f0 100644 --- a/Scripts/Utilities/UI_InfiniteScroll.cs +++ b/Runtime/Scripts/Utilities/UI_InfiniteScroll.cs @@ -1,5 +1,5 @@ /// Credit Tomasz Schelenz -/// Sourced from - https://bitbucket.org/ddreaper/unity-ui-extensions/issues/81/infinite-scrollrect +/// Sourced from - https://bitbucket.org/SimonDarksideJ/unity-ui-extensions/issues/81/infinite-scrollrect /// Demo - https://www.youtube.com/watch?v=uVTV7Udx78k - configures automatically. - works in both vertical and horizontal (but not both at the same time) - drag and drop - can be initialized by code (in case you populate your scrollview content from code) using System.Collections.Generic; @@ -82,7 +82,7 @@ namespace UnityEngine.UI.Extensions if (_isHorizontal && _isVertical) { - Debug.LogError("UI_InfiniteScroll doesn't support scrolling in both directions, plase choose one direction (horizontal or vertical)"); + Debug.LogError("UI_InfiniteScroll doesn't support scrolling in both directions, please choose one direction (horizontal or vertical)"); } _itemCount = _scrollRect.content.childCount; diff --git a/Scripts/Utilities/UI_InfiniteScroll.cs.meta b/Runtime/Scripts/Utilities/UI_InfiniteScroll.cs.meta similarity index 100% rename from Scripts/Utilities/UI_InfiniteScroll.cs.meta rename to Runtime/Scripts/Utilities/UI_InfiniteScroll.cs.meta diff --git a/Scripts/Utilities/UI_ScrollRectOcclusion.cs b/Runtime/Scripts/Utilities/UI_ScrollRectOcclusion.cs similarity index 90% rename from Scripts/Utilities/UI_ScrollRectOcclusion.cs rename to Runtime/Scripts/Utilities/UI_ScrollRectOcclusion.cs index e83f533..ff8f7e8 100644 --- a/Scripts/Utilities/UI_ScrollRectOcclusion.cs +++ b/Runtime/Scripts/Utilities/UI_ScrollRectOcclusion.cs @@ -1,6 +1,6 @@ /// Credit Tomasz Schelenz -/// Sourced from - https://bitbucket.org/ddreaper/unity-ui-extensions/issues/82/scrollrectocclusion -/// Demo - https://youtu.be/uVTV7Udx78k?t=39s ScrollRectOcclusion - disables the objects outside of the scrollrect viewport. Usefull for scrolls with lots of content, reduces geometry and drawcalls (if content is not batched) In some cases it might create a bit of spikes, especially if you have lots of UI.Text objects in the childs. In that case consider to Add CanvasGroup to your childs and instead of calling setActive on game object change CanvasGroup.alpha value. At 0 it is not being rendered hence will also optimize the prformance. +/// Sourced from - https://bitbucket.org/SimonDarksideJ/unity-ui-extensions/issues/82/scrollrectocclusion +/// Demo - https://youtu.be/uVTV7Udx78k?t=39s ScrollRectOcclusion - disables the objects outside of the scrollrect viewport. Useful for scrolls with lots of content, reduces geometry and drawcalls (if content is not batched) In some cases it might create a bit of spikes, especially if you have lots of UI.Text objects in the childs. In that case consider to Add CanvasGroup to your childs and instead of calling setActive on game object change CanvasGroup.alpha value. At 0 it is not being rendered hence will also optimize the performance. using System.Collections.Generic; diff --git a/Scripts/Utilities/UI_ScrollRectOcclusion.cs.meta b/Runtime/Scripts/Utilities/UI_ScrollRectOcclusion.cs.meta similarity index 100% rename from Scripts/Utilities/UI_ScrollRectOcclusion.cs.meta rename to Runtime/Scripts/Utilities/UI_ScrollRectOcclusion.cs.meta diff --git a/Scripts/Utilities/UI_TweenScale.cs b/Runtime/Scripts/Utilities/UI_TweenScale.cs similarity index 88% rename from Scripts/Utilities/UI_TweenScale.cs rename to Runtime/Scripts/Utilities/UI_TweenScale.cs index 21dac17..c32db92 100644 --- a/Scripts/Utilities/UI_TweenScale.cs +++ b/Runtime/Scripts/Utilities/UI_TweenScale.cs @@ -1,6 +1,6 @@ /// Credit Tomasz Schelenz -/// Sourced from - https://bitbucket.org/ddreaper/unity-ui-extensions/issues/83/ui_tweenscale -/// Demo - https://youtu.be/uVTV7Udx78k?t=1m33s Dynamic scalling of text or image (including button) based on curves. works on scrollrect scale so you can pretty much use it for any ui type. +/// Sourced from - https://bitbucket.org/SimonDarksideJ/unity-ui-extensions/issues/83/ui_tweenscale +/// Demo - https://youtu.be/uVTV7Udx78k?t=1m33s Dynamic scaling of text or image (including button) based on curves. works on scrollrect scale so you can pretty much use it for any ui type. /// Notes In some cases it can create spikes due to redrawing on change, it is recommended to use it on simple objects in separated canvases to avoid redrawing full canvas. @@ -9,7 +9,7 @@ using System.Collections; namespace UnityEngine.UI.Extensions { /// <summary> - /// Dynamic scalling of text or image (including button) based on curves + /// Dynamic scaling of text or image (including button) based on curves /// /// Fields /// - animCurve - animation curve for scale (if isUniform set to false, will apply only to X scale) diff --git a/Scripts/Utilities/UI_TweenScale.cs.meta b/Runtime/Scripts/Utilities/UI_TweenScale.cs.meta similarity index 100% rename from Scripts/Utilities/UI_TweenScale.cs.meta rename to Runtime/Scripts/Utilities/UI_TweenScale.cs.meta diff --git a/Scripts/Utilities/switchToRectTransform.cs b/Runtime/Scripts/Utilities/switchToRectTransform.cs similarity index 100% rename from Scripts/Utilities/switchToRectTransform.cs rename to Runtime/Scripts/Utilities/switchToRectTransform.cs diff --git a/Scripts/Utilities/switchToRectTransform.cs.meta b/Runtime/Scripts/Utilities/switchToRectTransform.cs.meta similarity index 100% rename from Scripts/Utilities/switchToRectTransform.cs.meta rename to Runtime/Scripts/Utilities/switchToRectTransform.cs.meta diff --git a/Scripts/VR Extensions.meta b/Runtime/Scripts/VR Extensions.meta similarity index 100% rename from Scripts/VR Extensions.meta rename to Runtime/Scripts/VR Extensions.meta diff --git a/Scripts/VR Extensions/VRCursor.cs b/Runtime/Scripts/VR Extensions/VRCursor.cs similarity index 100% rename from Scripts/VR Extensions/VRCursor.cs rename to Runtime/Scripts/VR Extensions/VRCursor.cs diff --git a/Scripts/VR Extensions/VRCursor.cs.meta b/Runtime/Scripts/VR Extensions/VRCursor.cs.meta similarity index 100% rename from Scripts/VR Extensions/VRCursor.cs.meta rename to Runtime/Scripts/VR Extensions/VRCursor.cs.meta diff --git a/Scripts/VR Extensions/VRInputModule.cs b/Runtime/Scripts/VR Extensions/VRInputModule.cs similarity index 100% rename from Scripts/VR Extensions/VRInputModule.cs rename to Runtime/Scripts/VR Extensions/VRInputModule.cs diff --git a/Scripts/VR Extensions/VRInputModule.cs.meta b/Runtime/Scripts/VR Extensions/VRInputModule.cs.meta similarity index 100% rename from Scripts/VR Extensions/VRInputModule.cs.meta rename to Runtime/Scripts/VR Extensions/VRInputModule.cs.meta diff --git a/UnityUIExtensions.asmdef b/Runtime/UnityUIExtensions.asmdef similarity index 100% rename from UnityUIExtensions.asmdef rename to Runtime/UnityUIExtensions.asmdef diff --git a/UnityUIExtensions.asmdef.meta b/Runtime/UnityUIExtensions.asmdef.meta similarity index 100% rename from UnityUIExtensions.asmdef.meta rename to Runtime/UnityUIExtensions.asmdef.meta diff --git a/Scripts/Layout/FancyScrollView/GridView/FancyGridView.cs b/Scripts/Layout/FancyScrollView/GridView/FancyGridView.cs deleted file mode 100644 index e74f517..0000000 --- a/Scripts/Layout/FancyScrollView/GridView/FancyGridView.cs +++ /dev/null @@ -1,144 +0,0 @@ -/// Credit setchi (https://github.com/setchi) -/// Sourced from - https://github.com/setchi/FancyScrollView - -using System; -using System.Collections.Generic; -using System.Linq; -using UnityEngine.UI.Extensions.EasingCore; - -namespace UnityEngine.UI.Extensions -{ - /// <summary> - /// グリッドレイアウトのスクロールビューを実装するための抽象基底クラス. - /// 無限スクロールおよびスナップには対応していません. - /// </summary> - /// <typeparam name="TItemData">アイテムのデータ型.</typeparam> - /// <typeparam name="TContext"><see cref="FancyScrollView{TItemData, TContext}.Context"/> の型.</typeparam> - public abstract class FancyGridView<TItemData, TContext> : FancyScrollRect<TItemData[], TContext> - where TContext : class, IFancyScrollRectContext, IFancyGridViewContext, new() - { - /// <summary> - /// カラム同士の余白. - /// </summary> - [SerializeField] protected float columnSpacing = 0f; - - GameObject cachedRowPrefab; - - /// <summary> - /// 行の Prefab. - /// </summary> - /// <remarks> - /// <see cref="FancyGridView{TItemData, TContext}"/> では, - /// <see cref="FancyScrollView{TItemData, TContext}.CellPrefab"/> を行オブジェクトとして使用します. - /// </remarks> - protected sealed override GameObject CellPrefab => cachedRowPrefab ?? (cachedRowPrefab = SetupRowTemplate()); - - /// <summary> - /// 一行あたりの要素数. - /// </summary> - protected abstract int ColumnCount { get; } - - /// <summary> - /// セルのテンプレート. - /// </summary> - protected abstract FancyScrollViewCell<TItemData, TContext> CellTemplate { get; } - - /// <summary> - /// 行オブジェクトのテンプレート. - /// </summary> - protected abstract FancyGridViewRow<TItemData, TContext> RowTemplate { get; } - - /// <summary> - /// アイテムの総数. - /// </summary> - public int DataCount { get; private set; } - - /// <inheritdoc/> - protected override void Initialize() - { - base.Initialize(); - - Debug.Assert(RowTemplate != null); - Debug.Assert(CellTemplate != null); - Debug.Assert(ColumnCount > 0); - - Context.CellTemplate = CellTemplate.gameObject; - Context.ScrollDirection = Scroller.ScrollDirection; - Context.GetColumnCount = () => ColumnCount; - Context.GetColumnSpacing = () => columnSpacing; - } - - /// <summary> - /// 行オブジェクトのセットアップを行います. - /// </summary> - /// <returns>行を構成する <c>GameObject</c>.</returns> - protected virtual GameObject SetupRowTemplate() - { - var cell = CellTemplate.GetComponent<RectTransform>(); - var row = RowTemplate.GetComponent<RectTransform>(); - - row.sizeDelta = Scroller.ScrollDirection == ScrollDirection.Horizontal - ? new Vector2(cell.rect.width, row.sizeDelta.y) - : new Vector2(row.sizeDelta.x, cell.rect.height); - - return row.gameObject; - } - - /// <summary> - /// 渡されたアイテム一覧に基づいて表示内容を更新します. - /// </summary> - /// <param name="items">アイテム一覧.</param> - public virtual void UpdateContents(IList<TItemData> items) - { - DataCount = items.Count; - - var rows = items - .Select((item, index) => (item, index)) - .GroupBy( - x => x.index / ColumnCount, - x => x.item) - .Select(group => group.ToArray()) - .ToArray(); - - UpdateContents(rows); - } - - /// <summary> - /// 指定したアイテムの位置まで移動します. - /// </summary> - /// <param name="itemIndex">アイテムのインデックス.</param> - /// <param name="duration">移動にかける秒数.</param> - /// <param name="alignment"><see cref="Alignment"/>.</param> - /// <param name="onComplete">移動が完了した際に呼び出されるコールバック.</param> - public override void ScrollTo(int itemIndex, float duration, Alignment alignment = Alignment.Center, Action onComplete = null) - { - var rowIndex = itemIndex / Context.GetColumnCount(); - base.ScrollTo(rowIndex, duration, alignment, onComplete); - } - - /// <summary> - /// 指定したアイテムの位置まで移動します. - /// </summary> - /// <param name="itemIndex">アイテムのインデックス.</param> - /// <param name="duration">移動にかける秒数.</param> - /// <param name="easing">移動に使用するイージング.</param> - /// <param name="alignment"><see cref="Alignment"/>.</param> - /// <param name="onComplete">移動が完了した際に呼び出されるコールバック.</param> - public override void ScrollTo(int itemIndex, float duration, Ease easing, Alignment alignment = Alignment.Center, Action onComplete = null) - { - var rowIndex = itemIndex / Context.GetColumnCount(); - base.ScrollTo(rowIndex, duration, easing, alignment, onComplete); - } - - /// <summary> - /// 指定したアイテムの位置までジャンプします. - /// </summary> - /// <param name="itemIndex">アイテムのインデックス.</param> - /// <param name="alignment"><see cref="Alignment"/>.</param> - public virtual void JumpTo(int itemIndex, Alignment alignment = Alignment.Center) - { - var rowIndex = itemIndex / Context.GetColumnCount(); - UpdatePosition(rowIndex, alignment); - } - } -} \ No newline at end of file diff --git a/Scripts/Layout/FancyScrollView/GridView/FancyGridViewRow.cs b/Scripts/Layout/FancyScrollView/GridView/FancyGridViewRow.cs deleted file mode 100644 index 3613bce..0000000 --- a/Scripts/Layout/FancyScrollView/GridView/FancyGridViewRow.cs +++ /dev/null @@ -1,81 +0,0 @@ -/// Credit setchi (https://github.com/setchi) -/// Sourced from - https://github.com/setchi/FancyScrollView - -using System.Linq; - -namespace UnityEngine.UI.Extensions -{ - /// <summary> - /// <see cref="FancyGridView{TItemData, TContext}"/> の行を実装するための抽象基底クラス. - /// </summary> - /// <typeparam name="TItemData">アイテムのデータ型.</typeparam> - /// <typeparam name="TContext"><see cref="FancyScrollViewCell{TItemData, TContext}.Context"/> の型.</typeparam> - public abstract class FancyGridViewRow<TItemData, TContext> : FancyScrollRectCell<TItemData[], TContext> - where TContext : class, IFancyScrollRectContext, IFancyGridViewContext, new() - { - /// <summary> - /// この行で表示するセルの配列. - /// </summary> - protected virtual FancyScrollViewCell<TItemData, TContext>[] Cells { get; private set; } - - /// <summary> - /// この行で表示するセルの配列をインスタンス化します. - /// </summary> - /// <returns>この行で表示するセルの配列.</returns> - protected virtual FancyScrollViewCell<TItemData, TContext>[] InstantiateCells() - { - return Enumerable.Range(0, Context.GetColumnCount()) - .Select(_ => Instantiate(Context.CellTemplate, transform)) - .Select(x => x.GetComponent<FancyScrollViewCell<TItemData, TContext>>()) - .ToArray(); - } - - /// <inheritdoc/> - public override void SetupContext(TContext context) - { - base.SetupContext(context); - - Cells = InstantiateCells(); - Debug.Assert(Cells.Length == Context.GetColumnCount()); - - for (var i = 0; i < Cells.Length; i++) - { - Cells[i].SetupContext(context); - } - } - - /// <inheritdoc/> - public override void UpdateContent(TItemData[] rowContents) - { - for (var i = 0; i < Cells.Length; i++) - { - Cells[i].Index = i + Index * Context.GetColumnCount(); - Cells[i].SetVisible(i < rowContents.Length); - - if (Cells[i].IsVisible) - { - Cells[i].UpdateContent(rowContents[i]); - } - } - } - - /// <inheritdoc/> - public override void UpdatePosition(float position) - { - base.UpdatePosition(position); - - for (var i = 0; i < Cells.Length; i++) - { - Cells[i].UpdatePosition(position); - } - } - - /// <inheritdoc/> - protected override void UpdatePosition(float position, float viewportPosition) - { - transform.localPosition = Context.ScrollDirection == ScrollDirection.Horizontal - ? new Vector2(viewportPosition, transform.localPosition.y) - : new Vector2(transform.localPosition.x, viewportPosition); - } - } -} \ No newline at end of file diff --git a/Scripts/Layout/FancyScrollView/ScrollRect/Alignment.cs b/Scripts/Layout/FancyScrollView/ScrollRect/Alignment.cs deleted file mode 100644 index d3c1566..0000000 --- a/Scripts/Layout/FancyScrollView/ScrollRect/Alignment.cs +++ /dev/null @@ -1,12 +0,0 @@ -/// Credit setchi (https://github.com/setchi) -/// Sourced from - https://github.com/setchi/FancyScrollView - -namespace UnityEngine.UI.Extensions -{ - public enum Alignment - { - Head, - Center, - Tail, - } -} \ No newline at end of file diff --git a/package.json b/package.json index 6b670e4..aa5218c 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "com.unity.uiextensions", "displayName": "Unity UI Extensions", - "version": "2.2.0-preview", + "version": "2.2.0", "description": "An extension project for the Unity3D UI system, all crafted and contributed by the awesome Unity community", "author": "Simon darkside Jackson <@SimonDarksideJ>", "contributors": [{