commit
fb986cefed
147
README.md
147
README.md
|
@ -3,9 +3,8 @@
|
|||
This is an extension project for the new Unity UI system which can be found at:
|
||||
[Unity UI Source](https://bitbucket.org/Unity-Technologies/ui)
|
||||
|
||||
#Updated for 5.2.1P+/5.3 - new asset package#
|
||||
#For Unity 5.2.2+ - Use the new 5.3 package!#
|
||||
#Issue with 5.3 package in 5.2.3 resolved, update asset from site#
|
||||
|
||||
|
||||
##Intro##
|
||||
For more info, here's a little introduction video for the project:
|
||||
|
@ -19,7 +18,6 @@ In this repository is a collection of extension scripts to enhance your Unity UI
|
|||
You can either download / fork the project to access the scripts, or you can download this precompiled Unity Asset, chock full of goodness
|
||||
### [Unity UI Extensions Unity 4.x Asset](https://bitbucket.org/ddreaper/unity-ui-extensions/downloads/UnityUIExtensions-4.x.unitypackage)###
|
||||
### [Unity UI Extensions Unity 5.1 Asset](https://bitbucket.org/ddreaper/unity-ui-extensions/downloads/UnityUIExtensions-5.1.unitypackage)###
|
||||
### [Unity UI Extensions Unity 5.2 Asset](https://bitbucket.org/ddreaper/unity-ui-extensions/downloads/UnityUIExtensions-5.2.unitypackage)###
|
||||
### [Unity UI Extensions Unity 5.3 (5.2.1P+) Asset](https://bitbucket.org/ddreaper/unity-ui-extensions/downloads/UnityUIExtensions-5.3.unitypackage) <- use this for 5.2.1P+ releases###
|
||||
|
||||
|
||||
|
@ -29,16 +27,20 @@ To get started with the project, here's a little guide:
|
|||
[![View Getting Started Video](http://img.youtube.com/vi/sVLeYmsNQAI/0.jpg)](http://www.youtube.com/watch?v=sVLeYmsNQAI "Unity UI getting started video")
|
||||
---
|
||||
## Updates: ##
|
||||
Update 1.0.4
|
||||
###Update 1.0.4###
|
||||
|
||||
[![View Getting Started Video](http://img.youtube.com/vi/oF48Qpaq3ls/0.jpg)](http://www.youtube.com/watch?v=oF48Qpaq3ls "Update 1.0.0.4 for the Unity UI Extensions Project")
|
||||
|
||||
Update 1.0.5
|
||||
---
|
||||
###Update 1.0.5###
|
||||
Few minor fixes and a couple of additional scripts. Predominatly created the new 5.3 branch to maintain the UI API changes from the 5.2.1 Patch releases. 5.3 package is 100% compatible with 5.2.1 Patch releases.
|
||||
|
||||
Update 1.0.6
|
||||
Added the awesome ReOrderable List control, plus some other minor bugfixes / changes.
|
||||
Added a new version of the Scroll Snap control as an alternative to the fixed versions.
|
||||
###Update 1.0.6###
|
||||
* Added the awesome ReOrderable List control, plus some other minor bugfixes / changes.
|
||||
* Added a new version of the Scroll Snap control as an alternative to the fixed versions.
|
||||
* New set of controls including some shader ennhanced solutions
|
||||
* I've added a donate column to the lists. If you are getting great use out of a control, help out the dev who created it. Optional of course. Will update with links as I get them.
|
||||
|
||||
Note to self, record video on this soon!! :S
|
||||
|
||||
---
|
||||
## Controls and extensions listed in this project are: ##
|
||||
|
@ -46,114 +48,114 @@ Added a new version of the Scroll Snap control as an alternative to the fixed ve
|
|||
## Controls ##
|
||||
================
|
||||
|
||||
Control | Description | Menu Command | Component Command | Notes | Credits
|
||||
Control | Description | Menu Command | Component Command | Notes | Donate | Credits
|
||||
--------- | -------------- | ---------------------- | ---------------------------- | ------- | ----------
|
||||
**Accordion** | An Acordian style control with animated segments. Sourced from [here]. | N/A | Component / UI / Extensions / AccordionGroup |[demo video](http://forum.unity3d.com/threads/accordion-type-layout.271818/)| ChoMPHi
|
||||
| | | Component / UI / Extensions / AccordionItem |[demo video](http://forum.unity3d.com/threads/accordion-type-layout.271818/)| ChoMPHi
|
||||
**HSVPicker** | A colour picker UI | N/A | UI / Extensions / HSVPicker | Project folder includes prefab and sample scene | judah4
|
||||
**SelectionBox** | An RTS style selection box control | UI / Extensions / Selection Box | UI / Extensions / Selection Box |[tutorial video](https://www.youtube.com/watch?v=UtM3HejKL5s)| Korindian, BenZed
|
||||
**UIButton** | Improved Button control with additional events (PointerDown, PointerUp, PointerClick and PointerHeld) | UI / Extensions / UI Button | UI / Extensions / UI Button |Will update video, this has now been updated to a more reusable Selectable extension| AriathTheWise
|
||||
**UIFlippable** | Improved Image control with image flipping options | UI / Extensions / UI Flippable | UI / Extensions / Flippable |[tutorial video](https://www.youtube.com/watch?v=Htt2RNa2qy0)| ChoMPHi
|
||||
**UIWindowBase** | A draggable Window implementation | UI / Extensions / UI Window Base | UI / Extensions / UI Window Base |[tutorial video](https://www.youtube.com/watch?v=Htt2RNa2qy0)| GXMark, alexzzzz, CaoMengde777, TroyDavis
|
||||
**ComboBox** | A fixed combobox implementation for text | UI / Extensions / ComboBox | UI / Extensions / ComboBox |[tutorial video](https://www.youtube.com/watch?v=JrEfs47FoOE)| Perchik
|
||||
**AutoCompleteComboBox** | A text combobox with autocomplete selection | UI / Extensions / AutoComplete ComboBox | UI / Extensions / AutoComplete ComboBox |[tutorial video](https://www.youtube.com/watch?v=JrEfs47FoOE)| Perchik
|
||||
**DropDownList** | A basic drop down list with text and image support | UI / Extensions / Dropdown List | UI / Extensions / Dropdown List |[tutorial video](https://www.youtube.com/watch?v=JrEfs47FoOE)| Perchik
|
||||
**BoundToolTip** | An alternate Tooltip implementation with central listener | UI / Extensions / Bound Tooltip / Tooltip | UI / Extensions / Bound Tooltip / Tooltip Item | Offset and tooltip placement needs work | Martin Sharkbomb
|
||||
| | | UI / Extensions / Bound Tooltip / Tooltip Trigger | | Martin Sharkbomb
|
||||
**Accordion** | An Acordian style control with animated segments. Sourced from [here]. | N/A | Component / UI / Extensions / AccordionGroup |[demo video](http://forum.unity3d.com/threads/accordion-type-layout.271818/)|| ChoMPHi
|
||||
| | | Component / UI / Extensions / AccordionItem |[demo video](http://forum.unity3d.com/threads/accordion-type-layout.271818/)|| ChoMPHi
|
||||
**HSVPicker** | A colour picker UI | N/A | UI / Extensions / HSVPicker | Project folder includes prefab and sample scene || judah4
|
||||
**SelectionBox** | An RTS style selection box control | UI / Extensions / Selection Box | UI / Extensions / Selection Box |[tutorial video](https://www.youtube.com/watch?v=UtM3HejKL5s)|| Korindian, BenZed
|
||||
**UIButton** | Improved Button control with additional events (PointerDown, PointerUp, PointerClick and PointerHeld) | UI / Extensions / UI Button | UI / Extensions / UI Button |Will update video, this has now been updated to a more reusable Selectable extension|| AriathTheWise
|
||||
**UIFlippable** | Improved Image control with image flipping options | UI / Extensions / UI Flippable | UI / Extensions / Flippable |[tutorial video](https://www.youtube.com/watch?v=Htt2RNa2qy0)|| ChoMPHi
|
||||
**UIWindowBase** | A draggable Window implementation | UI / Extensions / UI Window Base | UI / Extensions / UI Window Base |[tutorial video](https://www.youtube.com/watch?v=Htt2RNa2qy0)|| GXMark, alexzzzz, CaoMengde777, TroyDavis
|
||||
**ComboBox** | A fixed combobox implementation for text | UI / Extensions / ComboBox | UI / Extensions / ComboBox |[tutorial video](https://www.youtube.com/watch?v=JrEfs47FoOE)|| Perchik
|
||||
**AutoCompleteComboBox** | A text combobox with autocomplete selection | UI / Extensions / AutoComplete ComboBox | UI / Extensions / AutoComplete ComboBox |[tutorial video](https://www.youtube.com/watch?v=JrEfs47FoOE)|| Perchik
|
||||
**DropDownList** | A basic drop down list with text and image support | UI / Extensions / Dropdown List | UI / Extensions / Dropdown List |[tutorial video](https://www.youtube.com/watch?v=JrEfs47FoOE)|| Perchik
|
||||
**BoundToolTip** | An alternate Tooltip implementation with central listener | UI / Extensions / Bound Tooltip / Tooltip | UI / Extensions / Bound Tooltip / Tooltip Item | Offset and tooltip placement needs work || Martin Sharkbomb
|
||||
| | | UI / Extensions / Bound Tooltip / Tooltip Trigger ||| Martin Sharkbomb
|
||||
|
||||
|
||||
## Primitives ##
|
||||
================
|
||||
|
||||
Control | Description | Menu Command | Component Command | Notes | Credits
|
||||
Control | Description | Menu Command | Component Command | Notes | Donate | Credits
|
||||
--------- | -------------- | ---------------------- | ---------------------------- | ------- | ----------
|
||||
**LineRenderer** | Graphic control for drawing lines in the UI System | UI / Extensions / Primitives / UI Line Renderer | UI / Extensions / Primitives / UI Line Renderer |[tutorial video](https://www.youtube.com/watch?v=OElcWAZGHi0)| jack.sydorenko
|
||||
**UILineTextureRenderer** | Graphic control for drawing lines in the UI System | UI / Extensions / Primitives / UI Line Texture Renderer | UI / Extensions / Primitives / UI Line Texture Renderer |[tutorial video](https://www.youtube.com/watch?v=OElcWAZGHi0)| jack.sydorenko, jonbro5556
|
||||
**UICircle** | Graphic control for drawing circles in the UI System | UI / Extensions / Primitives / UI Circle | UI / Extensions / Primitives / UI Circle |[tutorial video](https://www.youtube.com/watch?v=2KOnEKAVua0)| zge
|
||||
**DiamondGraph** | Graphic control for drawing a diamond in the UI System | UI / Extensions / Primitives / DiamondGraph | UI / Extensions / Primitives / DiamondGraph |5.2+ only [tutorial video](https://www.youtube.com/watch?v=2KOnEKAVua0)| koohddang
|
||||
**UICornerCut** | Graphic control for drawing a diamond in the UI System | UI/Extensions/Primitives/Cut Corners | UI/Extensions/Primitives/Cut Corners || Freezy
|
||||
**LineRenderer** | Graphic control for drawing lines in the UI System | UI / Extensions / Primitives / UI Line Renderer | UI / Extensions / Primitives / UI Line Renderer |[tutorial video](https://www.youtube.com/watch?v=OElcWAZGHi0)|| jack.sydorenko
|
||||
**UILineTextureRenderer** | Graphic control for drawing lines in the UI System | UI / Extensions / Primitives / UI Line Texture Renderer | UI / Extensions / Primitives / UI Line Texture Renderer |[tutorial video](https://www.youtube.com/watch?v=OElcWAZGHi0)|| jack.sydorenko, jonbro5556
|
||||
**UICircle** | Graphic control for drawing circles in the UI System | UI / Extensions / Primitives / UI Circle | UI / Extensions / Primitives / UI Circle |[tutorial video](https://www.youtube.com/watch?v=2KOnEKAVua0)|| zge
|
||||
**DiamondGraph** | Graphic control for drawing a diamond in the UI System | UI / Extensions / Primitives / DiamondGraph | UI / Extensions / Primitives / DiamondGraph |5.2+ only [tutorial video](https://www.youtube.com/watch?v=2KOnEKAVua0)|| koohddang
|
||||
**UICornerCut** | Graphic control for drawing a diamond in the UI System | UI/Extensions/Primitives/Cut Corners | UI/Extensions/Primitives/Cut Corners ||| Freezy
|
||||
|
||||
|
||||
## Layouts ##
|
||||
================
|
||||
|
||||
Layout | Description | Menu Command | Component Command | Notes | Credits
|
||||
Layout | Description | Menu Command | Component Command | Notes | Donate | Credits
|
||||
--------- | -------------- | ---------------------- | ---------------------------- | ------- | ----------
|
||||
**HorizontalScrollSnap** | A pages scroll rect that can work in steps / pages, includes button support | UI / Extensions / Horizontal Scroll Snap | Layout / Extensions / Horizontal Scroll Snap |[tutorial video](https://www.youtube.com/watch?v=KJlIlWHlfMo)| BinaryX
|
||||
**VerticalScrollSnap** | A pages scroll rect that can work in steps / pages, includes button support | UI / Extensions / Vertical Scroll Snap | Layout / Extensions / Vertical Scroll Snap |[tutorial video](https://www.youtube.com/watch?v=KJlIlWHlfMo)| BinaryX, Simon Darkside Jackson
|
||||
**FlowLayoutGroup** | A more rugged grid style layout group || Layout / Extensions / Flow Layout Group | [Example Video](https://www.youtube.com/watch?v=tMe_3tJTZvc) | Simie
|
||||
**RadialLayout** | A radial layout system || Layout / Extensions / Radial Layout |[tutorial video](https://www.youtube.com/watch?v=iUlk0d2RDMs)| Danny Goodayle
|
||||
**TileSizeFitter** | A fitter layout that will shink / expand content by tiles || Layout / Extensions / TileSizeFitter |[tutorial video](https://www.youtube.com/watch?v=AkQNWl8mnxg)| Ges
|
||||
**ScrollSnap** | An alternate scroll snap control supporting both Horizontal and Vertial layous in one control | UI / Extensions / Fixed Item Scroll / Snap Horizontal Single Item||| xesenix
|
||||
|| UI / Extensions / Fixed Item Scroll / Snap Horizontal Multiple Item||| xesenix
|
||||
|| UI / Extensions / Fixed Item Scroll / Snap Vertical Single Item||| xesenix
|
||||
|| UI / Extensions / Fixed Item Scroll / Snap Vertical Multiple Item||| xesenix
|
||||
**ReorderableList** | A dynamic control allowing drag and drop of child elements with reordering support | UI/Extensions/Re-orderable Lists/Re-orderable Vertical Scroll Rect|UI/Extensions/Re-orderable list|[Example](http://i.giphy.com/3o85xri0ARKKSfDHIQ.gif)| Ziboo
|
||||
|| UI/Extensions/Re-orderable Lists/Re-orderable Horizontal Scroll Rect||| Ziboo
|
||||
|| UI/Extensions/Re-orderable Lists/Re-orderable Grid Scroll Rect||| Ziboo
|
||||
|| UI/Extensions/Re-orderable Lists/Re-orderable Vertical List||| Ziboo
|
||||
|| UI/Extensions/Re-orderable Lists/Re-orderable Hirizontal List||| Ziboo
|
||||
|| UI/Extensions/Re-orderable Lists/Re-orderable Grid||| Ziboo
|
||||
**HorizontalScrollSnap** | A pages scroll rect that can work in steps / pages, includes button support | UI / Extensions / Horizontal Scroll Snap | Layout / Extensions / Horizontal Scroll Snap |[tutorial video](https://www.youtube.com/watch?v=KJlIlWHlfMo)|| BinaryX
|
||||
**VerticalScrollSnap** | A pages scroll rect that can work in steps / pages, includes button support | UI / Extensions / Vertical Scroll Snap | Layout / Extensions / Vertical Scroll Snap |[tutorial video](https://www.youtube.com/watch?v=KJlIlWHlfMo)|| BinaryX, Simon Darkside Jackson
|
||||
**FlowLayoutGroup** | A more rugged grid style layout group || Layout / Extensions / Flow Layout Group | [Example Video](https://www.youtube.com/watch?v=tMe_3tJTZvc) || Simie
|
||||
**RadialLayout** | A radial layout system || Layout / Extensions / Radial Layout |[tutorial video](https://www.youtube.com/watch?v=iUlk0d2RDMs)|| Danny Goodayle
|
||||
**TileSizeFitter** | A fitter layout that will shink / expand content by tiles || Layout / Extensions / TileSizeFitter |[tutorial video](https://www.youtube.com/watch?v=AkQNWl8mnxg)|| Ges
|
||||
**ScrollSnap** | An alternate scroll snap control supporting both Horizontal and Vertial layous in one control | UI / Extensions / Fixed Item Scroll / Snap Horizontal Single Item|||| xesenix
|
||||
|| UI / Extensions / Fixed Item Scroll / Snap Horizontal Multiple Item|||| xesenix
|
||||
|| UI / Extensions / Fixed Item Scroll / Snap Vertical Single Item|||| xesenix
|
||||
|| UI / Extensions / Fixed Item Scroll / Snap Vertical Multiple Item|||| xesenix
|
||||
**ReorderableList** | A dynamic control allowing drag and drop of child elements with reordering support | UI/Extensions/Re-orderable Lists/Re-orderable Vertical Scroll Rect|UI/Extensions/Re-orderable list|[Example](http://i.giphy.com/3o85xri0ARKKSfDHIQ.gif)|| Ziboo
|
||||
|| UI/Extensions/Re-orderable Lists/Re-orderable Horizontal Scroll Rect|||| Ziboo
|
||||
|| UI/Extensions/Re-orderable Lists/Re-orderable Grid Scroll Rect|||| Ziboo
|
||||
|| UI/Extensions/Re-orderable Lists/Re-orderable Vertical List|||| Ziboo
|
||||
|| UI/Extensions/Re-orderable Lists/Re-orderable Hirizontal List|||| Ziboo
|
||||
|| UI/Extensions/Re-orderable Lists/Re-orderable Grid|||| Ziboo
|
||||
|
||||
|
||||
## Effect components ##
|
||||
=====================
|
||||
|
||||
Effect | Description | Component Command | Notes | Credits
|
||||
Effect | Description | Component Command | Notes | Donate | Credits
|
||||
--------- | -------------- | ---------------------------- | ------- | -----------
|
||||
**BestFitOutline** | An improved outline effect | UI / Effects / Extensions / Best Fit Outline | | Melang
|
||||
**CurvedText** | A Text vertex manipulator for those users NOT using TextMeshPro (why ever not?) | UI / Effects / Extensons / Curved Text | | Breyer
|
||||
**Gradient** | Apply vertex colours in a gradient on any UI object | UI / Effects / Extensions / Gradient | | Breyer
|
||||
**LetterSpacing** | Allows finers control of text spacing | UI / Effects / Extensions / Letter Spacing | | Deeperbeige
|
||||
**NicerOutline** | Another outline control | UI / Effects / Extensions / Nicer Outline | | Melang
|
||||
**RaycastMask** | An example of an enhanced mask component able to work with the image data. Enables picking on image parts and not just the Rect Transform | UI / Effects / Extensions / Raycast Mask | | senritsu
|
||||
**UIFlippable** | Image component effect to flip the graphic | UI / Effects / Extensions / UI Flippable | | ChoMPHi
|
||||
**BestFitOutline** | An improved outline effect | UI / Effects / Extensions / Best Fit Outline ||| Melang
|
||||
**CurvedText** | A Text vertex manipulator for those users NOT using TextMeshPro (why ever not?) | UI / Effects / Extensons / Curved Text ||| Breyer
|
||||
**Gradient** | Apply vertex colours in a gradient on any UI object | UI / Effects / Extensions / Gradient ||| Breyer
|
||||
**LetterSpacing** | Allows finers control of text spacing | UI / Effects / Extensions / Letter Spacing ||| Deeperbeige
|
||||
**NicerOutline** | Another outline control | UI / Effects / Extensions / Nicer Outline ||| Melang
|
||||
**RaycastMask** | An example of an enhanced mask component able to work with the image data. Enables picking on image parts and not just the Rect Transform | UI / Effects / Extensions / Raycast Mask ||| senritsu
|
||||
**UIFlippable** | Image component effect to flip the graphic | UI / Effects / Extensions / UI Flippable ||| ChoMPHi
|
||||
**UIImageCrop** | Shader based mask system which clips to specific ranges X&Y | UI / Effects / Extensions / UI Image Crop ||| 00christian00
|
||||
**SoftAlphaMask** | Shader based mask able to clip images using an alpha mask | UI / Effects / Extensions / Soft Mask Script ||| NemoKrad
|
||||
|
||||
|
||||
## VR Components##
|
||||
=======================
|
||||
|
||||
Component | Description | Component Command | Notes | Credits
|
||||
Component | Description | Component Command | Notes | Donate | Credits
|
||||
--------- | -------------- | ---------------------------- | ------- | ------
|
||||
**VRCursor** | Cursor script for VR use (requires VRInputModule) | UI / Extensions / VR Cursoe | | Ralph Barbagallo
|
||||
**VRInputModule** | Input module to support the VR Cursor | Event / Vr Input Module | | Ralph Barbagallo
|
||||
**VRCursor** | Cursor script for VR use (requires VRInputModule) | UI / Extensions / VR Cursoe ||| Ralph Barbagallo
|
||||
**VRInputModule** | Input module to support the VR Cursor | Event / Vr Input Module ||| Ralph Barbagallo
|
||||
|
||||
|
||||
## Input Modules ##
|
||||
=======================
|
||||
|
||||
Component | Description | Component Command | Notes | Credits
|
||||
Component | Description | Component Command | Notes | Donate | Credits
|
||||
--------- | -------------- | ---------------------------- | ------- | ------
|
||||
**AimerInputModule** | Replacement Input module to allow for a reciclue to interace with WorldSpace canvas UI | Event / Extensions / Aimer Input Module | | Chris Trueman
|
||||
**GamePadInputModule** | Stripped down SIM Input module for just gamepad/keybord input | Event / Extensions / GamePad Input Module | | Simon (darkside) Jackson
|
||||
**AimerInputModule** | Replacement Input module to allow for a reciclue to interace with WorldSpace canvas UI | Event / Extensions / Aimer Input Module ||| Chris Trueman
|
||||
**GamePadInputModule** | Stripped down SIM Input module for just gamepad/keybord input | Event / Extensions / GamePad Input Module ||| Simon (darkside) Jackson
|
||||
|
||||
## Additional Components##
|
||||
=======================
|
||||
|
||||
Component | Description | Component Command | Notes | Credits
|
||||
Component | Description | Component Command | Notes | Donate | Credits
|
||||
--------- | -------------- | ---------------------------- | ------- | ------
|
||||
**ReturnKeyTrigger** | Does something?? | UI / Extensions / ReturnKey Trigger | | Melang, ddreaper
|
||||
**TabNavigation** | An example Tab navigation script, updated to add manual navigation | UI / Extensions / Tab Navigation | | Melang, omatase
|
||||
**uGUITools** | | Menu / uGUI | | Senshi
|
||||
**ScrollRectTweener** | Tweening solution for ScrollRects, add smoothing automatically | UI / Extensions / ScrollRectTweener | | Martin Sharkbomb
|
||||
**ScrollRectLinker** | ScrollRect Linker script, enable multiple ScrollRects to move together | UI / Extensions / ScrollRectLinker | | Martin Sharkbomb
|
||||
**ScrollRectEx** | Improved ScrollRect control, enables support for Nested ScrollRects | UI / Extensions / ScrollRectEx | | CaptainSchnittchen, GamesRUs
|
||||
**InputFocus** | Enhanced InputField control for forms, enables Enter to submit and other features | UI / Extensions / InputFocus | | Zelek
|
||||
**ImageExtended** | Improved Image control with rotation support and use of filled type without an Image (useful for masks) | UI / Extensions / Image Extended | | Ges
|
||||
**UIScrollToSelection** | Enables a ScrollRect to scroll based on the selected child automatically | UI / Extensions / UIScrollToSelection | | zero3growlithe
|
||||
**UISelectableExtension** | Refactor of original UI Button control, can now add Press/Release and Hold events to any Selectable control | UI / Extensions / UI Selectable Extension | | AriathTheWise / Simon Jackson
|
||||
**switchToRectTransform** | RectTransform extension method to move one Rect to another | N/A | | Izitmee
|
||||
**ReturnKeyTrigger** | Does something?? | UI / Extensions / ReturnKey Trigger ||| Melang, ddreaper
|
||||
**TabNavigation** | An example Tab navigation script, updated to add manual navigation | UI / Extensions / Tab Navigation ||| Melang, omatase
|
||||
**uGUITools** | | Menu / uGUI ||| Senshi
|
||||
**ScrollRectTweener** | Tweening solution for ScrollRects, add smoothing automatically | UI / Extensions / ScrollRectTweener ||| Martin Sharkbomb
|
||||
**ScrollRectLinker** | ScrollRect Linker script, enable multiple ScrollRects to move together | UI / Extensions / ScrollRectLinker ||| Martin Sharkbomb
|
||||
**ScrollRectEx** | Improved ScrollRect control, enables support for Nested ScrollRects | UI / Extensions / ScrollRectEx ||| CaptainSchnittchen, GamesRUs
|
||||
**InputFocus** | Enhanced InputField control for forms, enables Enter to submit and other features | UI / Extensions / InputFocus ||| Zelek
|
||||
**ImageExtended** | Improved Image control with rotation support and use of filled type without an Image (useful for masks) | UI / Extensions / Image Extended ||| Ges
|
||||
**UIScrollToSelection** | Enables a ScrollRect to scroll based on the selected child automatically | UI / Extensions / UIScrollToSelection ||| zero3growlithe
|
||||
**UISelectableExtension** | Refactor of original UI Button control, can now add Press/Release and Hold events to any Selectable control | UI / Extensions / UI Selectable Extension ||| AriathTheWise / Simon Jackson
|
||||
**switchToRectTransform** | RectTransform extension method to move one Rect to another | N/A ||| Izitmee
|
||||
|
||||
|
||||
*More to come*
|
||||
|
||||
=======================
|
||||
### How do I get set up? ###
|
||||
|
||||
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 ###
|
||||
|
||||
Got a script you want added, then just fork and submit a PR. All contributions accepted (including fixes)
|
||||
Just ensure
|
||||
* The header of the script matches the standard used in all scripts
|
||||
|
@ -164,7 +166,6 @@ Just ensure
|
|||
All scripts conform to the BSD license and are free to use / distribute. See the [LICENSE](https://bitbucket.org/ddreaper/unity-ui-extensions/src/6d03f25b0150994afa97c6a55854d6ae696cad13/LICENSE?at=default) file for more information
|
||||
|
||||
### Like what you see? ###
|
||||
|
||||
All these scripts were put together for my latest book Unity3D UI Essentials
|
||||
Check out the [page on my blog](http://bit.ly/Unity3DUIEssentials) for more details and learn all about the inner workings of the new Unity UI System.
|
||||
|
||||
|
|
|
@ -157,7 +157,6 @@ namespace UnityEditor.UI
|
|||
GameObjectUtility.SetParentAndAlign(eventSystem, parent);
|
||||
esys = eventSystem.AddComponent<EventSystem>();
|
||||
eventSystem.AddComponent<StandaloneInputModule>();
|
||||
eventSystem.AddComponent<TouchInputModule>();
|
||||
|
||||
Undo.RegisterCreatedObjectUndo(eventSystem, "Create " + eventSystem.name);
|
||||
}
|
||||
|
@ -208,7 +207,7 @@ namespace UnityEditor.UI
|
|||
#region UI Extensions "Create" Menu items
|
||||
|
||||
#region Scroll Snap controls
|
||||
[MenuItem("GameObject/UI/Extensions/Horizontal Scroll Snap", false)]
|
||||
[MenuItem("GameObject/UI/Extensions/Horizontal Scroll Snap", false)]
|
||||
static public void AddHorizontalScrollSnap(MenuCommand menuCommand)
|
||||
{
|
||||
GameObject horizontalScrollSnapRoot = CreateUIElementRoot("Horizontal Scroll Snap", menuCommand, s_ThickGUIElementSize);
|
||||
|
@ -273,7 +272,7 @@ namespace UnityEditor.UI
|
|||
Selection.activeGameObject = horizontalScrollSnapRoot;
|
||||
}
|
||||
|
||||
[MenuItem("GameObject/UI/Extensions/Vertical Scroll Snap", false)]
|
||||
[MenuItem("GameObject/UI/Extensions/Vertical Scroll Snap", false)]
|
||||
static public void AddVerticallScrollSnap(MenuCommand menuCommand)
|
||||
{
|
||||
GameObject verticalScrollSnapRoot = CreateUIElementRoot("Vertical Scroll Snap", menuCommand, s_ThickGUIElementSize);
|
||||
|
@ -538,7 +537,7 @@ namespace UnityEditor.UI
|
|||
Selection.activeGameObject = go;
|
||||
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region Drop Down controls
|
||||
[MenuItem("GameObject/UI/Extensions/AutoComplete ComboBox", false)]
|
||||
|
@ -864,7 +863,7 @@ namespace UnityEditor.UI
|
|||
arrowTextCanvasGroup.blocksRaycasts = false;
|
||||
Selection.activeGameObject = dropDownListRoot;
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region RTS Selection box
|
||||
[MenuItem("GameObject/UI/Extensions/Selection Box", false)]
|
||||
|
@ -898,7 +897,7 @@ namespace UnityEditor.UI
|
|||
|
||||
Selection.activeGameObject = go;
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region Bound Tooltip
|
||||
[MenuItem("GameObject/UI/Extensions/Bound Tooltip/Tooltip", false)]
|
||||
|
@ -948,7 +947,7 @@ namespace UnityEditor.UI
|
|||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region Progress bar
|
||||
[MenuItem("GameObject/UI/Extensions/Progress Bar", false)]
|
||||
|
@ -995,7 +994,7 @@ namespace UnityEditor.UI
|
|||
slider.direction = Slider.Direction.LeftToRight;
|
||||
SetDefaultColorTransitionValues(slider);
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region Primitives
|
||||
|
||||
|
@ -1038,7 +1037,7 @@ namespace UnityEditor.UI
|
|||
go.AddComponent<UICornerCut>();
|
||||
Selection.activeGameObject = go;
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region Re-Orderable Lists
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
fileFormatVersion: 2
|
||||
guid: ce526e6e0c6202e4e9c5ee35dd79295d
|
||||
guid: cbbc72115bdf3fe4a93d8566634c6e61
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
userData:
|
|
@ -0,0 +1,164 @@
|
|||
/// Credit NemoKrad (aka Charles Humphrey)
|
||||
/// Sourced from - http://www.randomchaos.co.uk/SoftAlphaUIMask.aspx
|
||||
|
||||
namespace UnityEngine.UI.Extensions
|
||||
{
|
||||
[ExecuteInEditMode]
|
||||
[AddComponentMenu("UI/Effects/Extensions/SoftMaskScript")]
|
||||
public class SoftMaskScript : MonoBehaviour
|
||||
{
|
||||
Material mat;
|
||||
Canvas canvas;
|
||||
|
||||
[Tooltip("The area that is to be used as the container.")]
|
||||
public RectTransform MaskArea;
|
||||
RectTransform myRect;
|
||||
|
||||
[Tooltip("Texture to be used to do the soft alpha")]
|
||||
public Texture AlphaMask;
|
||||
|
||||
[Tooltip("At what point to apply the alpha min range 0-1")]
|
||||
[Range(0, 1)]
|
||||
public float CutOff = 0;
|
||||
|
||||
[Tooltip("Implement a hard blend based on the Cutoff")]
|
||||
public bool HardBlend = false;
|
||||
|
||||
Vector3[] worldCorners;
|
||||
|
||||
Vector2 AlphaUV;
|
||||
|
||||
Vector2 min;
|
||||
Vector2 max = Vector2.one;
|
||||
Vector2 p;
|
||||
Vector2 siz;
|
||||
|
||||
Rect maskRect;
|
||||
Rect contentRect;
|
||||
|
||||
Vector2 centre;
|
||||
|
||||
bool isText = false;
|
||||
|
||||
// Use this for initialization
|
||||
void Start()
|
||||
{
|
||||
myRect = GetComponent<RectTransform>();
|
||||
|
||||
if (!MaskArea)
|
||||
{
|
||||
MaskArea = myRect;
|
||||
}
|
||||
|
||||
if (GetComponent<Graphic>() != null)
|
||||
{
|
||||
mat = new Material(Shader.Find("UI Extensions/SoftMaskShader"));
|
||||
GetComponent<Graphic>().material = mat;
|
||||
}
|
||||
|
||||
if (GetComponent<Text>())
|
||||
{
|
||||
isText = true;
|
||||
mat = new Material(Shader.Find("UI Extensions/SoftMaskShaderText"));
|
||||
GetComponent<Text>().material = mat;
|
||||
|
||||
GetCanvas();
|
||||
|
||||
// For some reason, having the mask control on the parent and disabled stops the mouse interacting
|
||||
// with the texture layer that is not visible.. Not needed for the Image.
|
||||
if (transform.parent.GetComponent<Mask>() == null)
|
||||
transform.parent.gameObject.AddComponent<Mask>();
|
||||
|
||||
transform.parent.GetComponent<Mask>().enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
void GetCanvas()
|
||||
{
|
||||
Transform t = transform;
|
||||
|
||||
int lvlLimit = 100;
|
||||
int lvl = 0;
|
||||
|
||||
while (canvas == null && lvl < lvlLimit)
|
||||
{
|
||||
canvas = t.gameObject.GetComponent<Canvas>();
|
||||
if (canvas == null)
|
||||
t = GetParentTranform(t);
|
||||
|
||||
lvl++;
|
||||
}
|
||||
}
|
||||
|
||||
Transform GetParentTranform(Transform t)
|
||||
{
|
||||
return t.parent;
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
SetMask();
|
||||
}
|
||||
|
||||
void SetMask()
|
||||
{
|
||||
// Get the two rectangle areas
|
||||
maskRect = MaskArea.rect;
|
||||
contentRect = myRect.rect;
|
||||
|
||||
if (isText) // Need to do our calculations in world for Text
|
||||
{
|
||||
if (canvas.renderMode == RenderMode.ScreenSpaceOverlay && Application.isPlaying)
|
||||
{
|
||||
p = canvas.transform.InverseTransformPoint(MaskArea.transform.position);
|
||||
siz = new Vector2(maskRect.width, maskRect.height);
|
||||
}
|
||||
else
|
||||
{
|
||||
worldCorners = new Vector3[4];
|
||||
MaskArea.GetWorldCorners(worldCorners);
|
||||
siz = (worldCorners[2] - worldCorners[0]);
|
||||
p = MaskArea.transform.position;
|
||||
}
|
||||
|
||||
min = p - (new Vector2(siz.x, siz.y) * .5f);
|
||||
max = p + (new Vector2(siz.x, siz.y) * .5f);
|
||||
}
|
||||
else // Need to do our calculations in tex space for Image.
|
||||
{
|
||||
// Get the centre offset
|
||||
centre = myRect.transform.InverseTransformPoint(MaskArea.transform.position);
|
||||
|
||||
// Set the scale for mapping texcoords mask
|
||||
AlphaUV = new Vector2(maskRect.width / contentRect.width, maskRect.height / contentRect.height);
|
||||
|
||||
// set my min and max to the centre offest
|
||||
min = centre;
|
||||
max = min;
|
||||
|
||||
siz = new Vector2(maskRect.width, maskRect.height) * .5f;
|
||||
// Move them out to the min max extreams
|
||||
min -= siz;
|
||||
max += siz;
|
||||
|
||||
// Now move these into texture space. 0 - 1
|
||||
min = new Vector2(min.x / contentRect.width, min.y / contentRect.height) + new Vector2(.5f, .5f);
|
||||
max = new Vector2(max.x / contentRect.width, max.y / contentRect.height) + new Vector2(.5f, .5f);
|
||||
|
||||
}
|
||||
|
||||
mat.SetFloat("_HardBlend", HardBlend ? 1 : 0);
|
||||
|
||||
// Pass the values to the shader
|
||||
mat.SetVector("_Min", min);
|
||||
mat.SetVector("_Max", max);
|
||||
|
||||
mat.SetTexture("_AlphaMask", AlphaMask);
|
||||
|
||||
if (!isText) // No mod needed for Text
|
||||
mat.SetVector("_AlphaUV", AlphaUV);
|
||||
|
||||
mat.SetFloat("_CutOff", CutOff);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
fileFormatVersion: 2
|
||||
guid: b8ee60af491978345bc197ed4e1316bc
|
||||
timeCreated: 1448034177
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,70 @@
|
|||
/// Credit 00christian00
|
||||
/// Sourced from - http://forum.unity3d.com/threads/any-way-to-show-part-of-an-image-without-using-mask.360085/#post-2332030
|
||||
|
||||
|
||||
namespace UnityEngine.UI.Extensions
|
||||
{
|
||||
[AddComponentMenu("UI/Effects/Extensions/UIImageCrop")]
|
||||
[ExecuteInEditMode]
|
||||
[RequireComponent(typeof(RectTransform))]
|
||||
public class UIImageCrop : MonoBehaviour
|
||||
{
|
||||
MaskableGraphic mGraphic;
|
||||
Material mat;
|
||||
int XCropProperty, YCropProperty;
|
||||
public float XCrop = 0f;
|
||||
public float YCrop = 0f;
|
||||
|
||||
|
||||
// Use this for initialization
|
||||
void Start()
|
||||
{
|
||||
SetMaterial();
|
||||
}
|
||||
|
||||
public void SetMaterial()
|
||||
{
|
||||
mGraphic = this.GetComponent<MaskableGraphic>();
|
||||
XCropProperty = Shader.PropertyToID("_XCrop");
|
||||
YCropProperty = Shader.PropertyToID("_YCrop");
|
||||
if (mGraphic != null)
|
||||
{
|
||||
if (mGraphic.material == null || mGraphic.material.name == "Default UI Material")
|
||||
{
|
||||
//Applying default material with UI Image Crop shader
|
||||
mGraphic.material = new Material(Shader.Find("UI Extensions/UI Image Crop"));
|
||||
}
|
||||
mat = mGraphic.material;
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogError("Please attach component to a Graphical UI component");
|
||||
}
|
||||
}
|
||||
public void OnValidate()
|
||||
{
|
||||
SetMaterial();
|
||||
SetXCrop(XCrop);
|
||||
SetYCrop(YCrop);
|
||||
}
|
||||
/// <summary>
|
||||
/// Set the x crop factor, with x being a normalized value 0-1f.
|
||||
/// </summary>
|
||||
/// <param name="xcrop"></param>
|
||||
public void SetXCrop(float xcrop)
|
||||
{
|
||||
XCrop = Mathf.Clamp01(xcrop);
|
||||
mat.SetFloat(XCropProperty, XCrop);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set the y crop factor, with y being a normalized value 0-1f.
|
||||
/// </summary>
|
||||
/// <param name="ycrop"></param>
|
||||
public void SetYCrop(float ycrop)
|
||||
{
|
||||
YCrop = Mathf.Clamp01(ycrop);
|
||||
mat.SetFloat(YCropProperty, YCrop);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 022c3983095dce44c9504739a8ed7324
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
|
@ -74,7 +74,7 @@ namespace UnityEngine.UI.Extensions
|
|||
public Button prevButton;
|
||||
|
||||
[Tooltip("Number of items visible in one page of scroll frame.")]
|
||||
[RangeAttribute(1,100)]
|
||||
[RangeAttribute(1, 100)]
|
||||
public int itemsVisibleAtOnce = 1;
|
||||
|
||||
[Tooltip("Sets minimum width of list items to 1/itemsVisibleAtOnce.")]
|
||||
|
@ -121,14 +121,18 @@ namespace UnityEngine.UI.Extensions
|
|||
|
||||
if (nextButton)
|
||||
{
|
||||
nextButton.GetComponent<Button>().onClick.AddListener(() => {
|
||||
NextScreen(); });
|
||||
nextButton.GetComponent<Button>().onClick.AddListener(() =>
|
||||
{
|
||||
NextScreen();
|
||||
});
|
||||
}
|
||||
|
||||
if (prevButton)
|
||||
{
|
||||
prevButton.GetComponent<Button>().onClick.AddListener(() => {
|
||||
PreviousScreen(); });
|
||||
prevButton.GetComponent<Button>().onClick.AddListener(() =>
|
||||
{
|
||||
PreviousScreen();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -165,7 +169,7 @@ namespace UnityEngine.UI.Extensions
|
|||
{
|
||||
foreach (var tr in listContainerTransform)
|
||||
{
|
||||
GameObject child = ((Transform) tr).gameObject;
|
||||
GameObject child = ((Transform)tr).gameObject;
|
||||
if (child.activeInHierarchy)
|
||||
{
|
||||
var childLayout = child.GetComponent<LayoutElement>();
|
||||
|
@ -183,7 +187,7 @@ namespace UnityEngine.UI.Extensions
|
|||
{
|
||||
foreach (var tr in listContainerTransform)
|
||||
{
|
||||
GameObject child = ((Transform) tr).gameObject;
|
||||
GameObject child = ((Transform)tr).gameObject;
|
||||
if (child.activeInHierarchy)
|
||||
{
|
||||
var childLayout = child.GetComponent<LayoutElement>();
|
||||
|
@ -209,7 +213,7 @@ namespace UnityEngine.UI.Extensions
|
|||
|
||||
foreach (var tr in listContainerTransform)
|
||||
{
|
||||
if (((Transform) tr).gameObject.activeInHierarchy)
|
||||
if (((Transform)tr).gameObject.activeInHierarchy)
|
||||
{
|
||||
activeCount++;
|
||||
}
|
||||
|
@ -225,7 +229,6 @@ namespace UnityEngine.UI.Extensions
|
|||
|
||||
if (direction == ScrollDirection.Horizontal)
|
||||
{
|
||||
//Debug.Log ("-------------looking for list spanning range----------------");
|
||||
// looking for list spanning range min/max
|
||||
scrollRect.horizontalNormalizedPosition = 0;
|
||||
listContainerMaxPosition = listContainerTransform.localPosition.x;
|
||||
|
@ -233,10 +236,8 @@ namespace UnityEngine.UI.Extensions
|
|||
listContainerMinPosition = listContainerTransform.localPosition.x;
|
||||
|
||||
listContainerSize = listContainerMaxPosition - listContainerMinPosition;
|
||||
//itemSize = pages > 1 ? listContainerSize / (float)(pages - 1) : listContainerSize / activeCount;
|
||||
//itemSize *= (pages + itemsVisibleAtOnce) / (pages + 1);
|
||||
|
||||
for (var i = 0; i < pages; i ++)
|
||||
for (var i = 0; i < pages; i++)
|
||||
{
|
||||
pageAnchorPositions[i] = new Vector3(
|
||||
listContainerMaxPosition - itemSize * i,
|
||||
|
@ -244,8 +245,6 @@ namespace UnityEngine.UI.Extensions
|
|||
listContainerTransform.localPosition.z
|
||||
);
|
||||
}
|
||||
|
||||
//Debug.Log (String.Format("min:{0:0.0}, max:{1:0.0}, pages: {2:0}, width: {3:0}", listContainerMinPosition, listContainerMaxPosition, pages, listContainerSize/pages));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -257,20 +256,15 @@ namespace UnityEngine.UI.Extensions
|
|||
listContainerMaxPosition = listContainerTransform.localPosition.y;
|
||||
|
||||
listContainerSize = listContainerMaxPosition - listContainerMinPosition;
|
||||
//itemSize = pages > 1 ? listContainerSize / (float)(pages - 1) : listContainerSize / activeCount;
|
||||
//itemSize *= (pages + itemsVisibleAtOnce) / (pages + 1);
|
||||
|
||||
for (var i = 0; i < pages; i ++)
|
||||
for (var i = 0; i < pages; i++)
|
||||
{
|
||||
pageAnchorPositions[i] = new Vector3(
|
||||
listContainerTransform.localPosition.x,
|
||||
listContainerMinPosition + itemSize * i,
|
||||
listContainerTransform.localPosition.z
|
||||
);
|
||||
//Debug.Log (String.Format("pos[{0:0}]={1} {2:0%}", i, pageAnchorPositions[i], pages > 1 ? i/(float)(pages-1) : (float)i));
|
||||
}
|
||||
|
||||
//Debug.Log (String.Format("min:{0:0.0}, max:{1:0.0}, pages: {2:0}, width: {3:0}", listContainerMinPosition, listContainerMaxPosition, pages, listContainerSize/pages));
|
||||
}
|
||||
|
||||
UpdateScrollbar(linkScrolbarSteps);
|
||||
|
@ -293,11 +287,11 @@ namespace UnityEngine.UI.Extensions
|
|||
{
|
||||
if (direction == ScrollDirection.Horizontal)
|
||||
{
|
||||
scrollRect.horizontalNormalizedPosition = pages > 1 ? (float) startingPage / (float) (pages - 1) : 0;
|
||||
scrollRect.horizontalNormalizedPosition = pages > 1 ? (float)startingPage / (float)(pages - 1) : 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
scrollRect.verticalNormalizedPosition = pages > 1 ? (float) (pages - startingPage - 1) / (float) (pages - 1) : 0;
|
||||
scrollRect.verticalNormalizedPosition = pages > 1 ? (float)(pages - startingPage - 1) / (float)(pages - 1) : 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -356,8 +350,6 @@ namespace UnityEngine.UI.Extensions
|
|||
lerp = false;
|
||||
|
||||
UpdateScrollbar(linkScrolbarSteps);
|
||||
|
||||
//Debug.Log(String.Format("Lerp: {0}/{1} page: {2:0}", lerpTarget, listContainerTransform.localPosition, CurrentPage()));
|
||||
}
|
||||
|
||||
//change the info bullets at the bottom of the screen. Just for visual effect
|
||||
|
@ -371,8 +363,6 @@ namespace UnityEngine.UI.Extensions
|
|||
{
|
||||
fastSwipeCounter++;
|
||||
}
|
||||
|
||||
//Debug.Log(String.Format("Update: {0}", listContainerTransform.localPosition));
|
||||
}
|
||||
|
||||
private bool fastSwipe = false; //to determine if a fast swipe was performed
|
||||
|
@ -453,8 +443,6 @@ namespace UnityEngine.UI.Extensions
|
|||
|
||||
float page = pos / itemSize;
|
||||
|
||||
//Debug.Log (String.Format("min:{0:0.0}, max:{1:0.0}, current:{2:0.0}/{4:0.0}, page:{3:0.0}, target:{5}", listContainerMinPosition, listContainerMaxPosition, pos, page, listContainerTransform.localPosition.x, pageAnchorPositions[Mathf.RoundToInt(page)]));
|
||||
|
||||
return Mathf.Clamp(Mathf.RoundToInt(page), 0, pages);
|
||||
}
|
||||
|
||||
|
@ -501,8 +489,6 @@ namespace UnityEngine.UI.Extensions
|
|||
|
||||
positionOnDragStart = eventData.position;
|
||||
pageOnDragStart = CurrentPage();
|
||||
|
||||
//Debug.Log (String.Format("pageOnDragStart:{0:0}", pageOnDragStart));
|
||||
}
|
||||
|
||||
public void OnEndDrag(PointerEventData eventData)
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 352ff938beb16ef47a9782242565c799
|
||||
folderAsset: yes
|
||||
timeCreated: 1446117980
|
||||
licenseType: Pro
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,5 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 0873351fdb3a65f43901b3ec088375b0
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
userData:
|
|
@ -0,0 +1,155 @@
|
|||
Shader "UI Extensions/SoftMaskShader"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
[PerRendererData] _MainTex("Sprite Texture", 2D) = "white" {}
|
||||
_Color("Tint", Color) = (1,1,1,1)
|
||||
|
||||
_StencilComp("Stencil Comparison", Float) = 8
|
||||
_Stencil("Stencil ID", Float) = 0
|
||||
_StencilOp("Stencil Operation", Float) = 0
|
||||
_StencilWriteMask("Stencil Write Mask", Float) = 255
|
||||
_StencilReadMask("Stencil Read Mask", Float) = 255
|
||||
|
||||
_ColorMask("Color Mask", Float) = 15
|
||||
|
||||
_Min("Min",Vector) = (0,0,0,0)
|
||||
_Max("Max",Vector) = (1,1,0,0)
|
||||
_AlphaMask("AlphaMask - Must be Wrapped",2D) = "white"{}
|
||||
_AlphaUV("AlphaUV",Vector) = (0,0,0,0)
|
||||
_CutOff("CutOff",Float) = 0
|
||||
[MaterialToggle]
|
||||
_HardBlend("HardBlend",Float) = 0
|
||||
}
|
||||
|
||||
SubShader
|
||||
{
|
||||
Tags
|
||||
{
|
||||
"Queue" = "Transparent"
|
||||
"IgnoreProjector" = "True"
|
||||
"RenderType" = "Transparent"
|
||||
"PreviewType" = "Plane"
|
||||
"CanUseSpriteAtlas" = "True"
|
||||
}
|
||||
|
||||
Stencil
|
||||
{
|
||||
Ref[_Stencil]
|
||||
Comp[_StencilComp]
|
||||
Pass[_StencilOp]
|
||||
ReadMask[_StencilReadMask]
|
||||
WriteMask[_StencilWriteMask]
|
||||
}
|
||||
|
||||
Cull Off
|
||||
Lighting Off
|
||||
ZWrite Off
|
||||
ZTest[unity_GUIZTestMode]
|
||||
Blend SrcAlpha OneMinusSrcAlpha
|
||||
ColorMask[_ColorMask]
|
||||
|
||||
Pass
|
||||
{
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
struct appdata_t
|
||||
{
|
||||
float4 vertex : POSITION;
|
||||
float4 color : COLOR;
|
||||
float2 texcoord : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct v2f
|
||||
{
|
||||
float4 vertex : SV_POSITION;
|
||||
fixed4 color : COLOR;
|
||||
half2 texcoord : TEXCOORD0;
|
||||
float4 worldPosition : TEXCOORD1;
|
||||
};
|
||||
|
||||
inline float UnityGet2DClipping (in float2 position, in float4 clipRect)
|
||||
{
|
||||
float2 inside = step(clipRect.xy, position.xy) * step(position.xy, clipRect.zw);
|
||||
return inside.x * inside.y;
|
||||
}
|
||||
|
||||
fixed4 _Color;
|
||||
fixed4 _TextureSampleAdd;
|
||||
|
||||
bool _UseClipRect;
|
||||
float4 _ClipRect;
|
||||
|
||||
bool _UseAlphaClip;
|
||||
|
||||
float4 _ProgressColor;
|
||||
float _Value;
|
||||
int _LeftToRight;
|
||||
|
||||
v2f vert(appdata_t IN)
|
||||
{
|
||||
v2f OUT;
|
||||
OUT.worldPosition = IN.vertex;
|
||||
OUT.vertex = mul(UNITY_MATRIX_MVP, OUT.worldPosition);
|
||||
|
||||
OUT.texcoord = IN.texcoord;
|
||||
|
||||
#ifdef UNITY_HALF_TEXEL_OFFSET
|
||||
OUT.vertex.xy += (_ScreenParams.zw - 1.0)*float2(-1,1);
|
||||
#endif
|
||||
|
||||
OUT.color = IN.color * _Color;
|
||||
return OUT;
|
||||
}
|
||||
|
||||
sampler2D _MainTex;
|
||||
sampler2D _AlphaMask;
|
||||
|
||||
float2 _AlphaUV;
|
||||
|
||||
float2 _Min;
|
||||
float2 _Max;
|
||||
|
||||
float _CutOff;
|
||||
|
||||
bool _HardBlend = false;
|
||||
|
||||
fixed4 frag(v2f IN) : SV_Target
|
||||
{
|
||||
half4 color = (tex2D(_MainTex, IN.texcoord) + _TextureSampleAdd) * IN.color;
|
||||
|
||||
|
||||
// Do we want to clip the image to the Mask Rectangle?
|
||||
if (IN.texcoord.x < _Min.x || IN.texcoord.x > _Max.x || IN.texcoord.y < _Min.y || IN.texcoord.y > _Max.y) // Yes we do
|
||||
color.a = 0;
|
||||
else // It's in the mask rectangle, so apply the alpha of the mask provided.
|
||||
{
|
||||
float a = tex2D(_AlphaMask, (IN.texcoord - _Min) / _AlphaUV).a;
|
||||
|
||||
if (a <= _CutOff)
|
||||
a = 0;
|
||||
else
|
||||
{
|
||||
if(_HardBlend)
|
||||
a = 1;
|
||||
}
|
||||
|
||||
color.a = a;
|
||||
}
|
||||
|
||||
if (_UseClipRect)
|
||||
color *= UnityGet2DClipping(IN.worldPosition.xy, _ClipRect);
|
||||
|
||||
if (_UseAlphaClip)
|
||||
clip(color.a - 0.001);
|
||||
|
||||
return color;
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 947afae4d36f1274ea2e4098262ceef6
|
||||
timeCreated: 1444851202
|
||||
licenseType: Pro
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,156 @@
|
|||
Shader "UI Extensions/SoftMaskShaderText"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
[PerRendererData] _MainTex("Sprite Texture", 2D) = "white" {}
|
||||
_Color("Tint", Color) = (1,1,1,1)
|
||||
|
||||
_StencilComp("Stencil Comparison", Float) = 8
|
||||
_Stencil("Stencil ID", Float) = 0
|
||||
_StencilOp("Stencil Operation", Float) = 0
|
||||
_StencilWriteMask("Stencil Write Mask", Float) = 255
|
||||
_StencilReadMask("Stencil Read Mask", Float) = 255
|
||||
|
||||
_ColorMask("Color Mask", Float) = 15
|
||||
|
||||
_Min("Min",Vector) = (0,0,0,0)
|
||||
_Max("Max",Vector) = (1,1,0,0)
|
||||
_AlphaMask("AlphaMask - Must be Wrapped",2D) = "white"{}
|
||||
_CutOff("CutOff",Float) = 0
|
||||
[MaterialToggle]
|
||||
_HardBlend("HardBlend",Float) = 0
|
||||
}
|
||||
|
||||
SubShader
|
||||
{
|
||||
Tags
|
||||
{
|
||||
"Queue" = "Transparent"
|
||||
"IgnoreProjector" = "True"
|
||||
"RenderType" = "Transparent"
|
||||
"PreviewType" = "Plane"
|
||||
"CanUseSpriteAtlas" = "True"
|
||||
}
|
||||
|
||||
Stencil
|
||||
{
|
||||
Ref[_Stencil]
|
||||
Comp[_StencilComp]
|
||||
Pass[_StencilOp]
|
||||
ReadMask[_StencilReadMask]
|
||||
WriteMask[_StencilWriteMask]
|
||||
}
|
||||
|
||||
Cull Off
|
||||
Lighting Off
|
||||
ZWrite Off
|
||||
ZTest[unity_GUIZTestMode]
|
||||
Blend SrcAlpha OneMinusSrcAlpha
|
||||
ColorMask[_ColorMask]
|
||||
|
||||
Pass
|
||||
{
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
struct appdata_t
|
||||
{
|
||||
float4 vertex : POSITION;
|
||||
float4 color : COLOR;
|
||||
float2 texcoord : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct v2f
|
||||
{
|
||||
float4 vertex : SV_POSITION;
|
||||
fixed4 color : COLOR;
|
||||
half2 texcoord : TEXCOORD0;
|
||||
float4 worldPosition : TEXCOORD1;
|
||||
float4 worldPosition2 : COLOR1;
|
||||
};
|
||||
|
||||
inline float UnityGet2DClipping (in float2 position, in float4 clipRect)
|
||||
{
|
||||
float2 inside = step(clipRect.xy, position.xy) * step(position.xy, clipRect.zw);
|
||||
return inside.x * inside.y;
|
||||
}
|
||||
|
||||
fixed4 _Color;
|
||||
fixed4 _TextureSampleAdd;
|
||||
|
||||
bool _UseClipRect;
|
||||
float4 _ClipRect;
|
||||
|
||||
bool _UseAlphaClip;
|
||||
|
||||
float4 _ProgressColor;
|
||||
float _Value;
|
||||
int _LeftToRight;
|
||||
|
||||
bool _HardBlend = false;
|
||||
|
||||
v2f vert(appdata_t IN)
|
||||
{
|
||||
v2f OUT;
|
||||
OUT.worldPosition = IN.vertex;
|
||||
OUT.vertex = mul(UNITY_MATRIX_MVP, OUT.worldPosition);
|
||||
OUT.worldPosition2 = mul(_Object2World, IN.vertex);
|
||||
|
||||
OUT.texcoord = IN.texcoord;
|
||||
|
||||
#ifdef UNITY_HALF_TEXEL_OFFSET
|
||||
OUT.vertex.xy += (_ScreenParams.zw - 1.0)*float2(-1,1);
|
||||
OUT.worldPosition2 += (_ScreenParams.zw - 1.0)*float2(-1, 1);
|
||||
#endif
|
||||
|
||||
OUT.color = IN.color * _Color;
|
||||
return OUT;
|
||||
}
|
||||
|
||||
sampler2D _MainTex;
|
||||
sampler2D _AlphaMask;
|
||||
|
||||
float2 _Min;
|
||||
float2 _Max;
|
||||
|
||||
float2 _Mul;
|
||||
|
||||
float _CutOff;
|
||||
|
||||
fixed4 frag(v2f IN) : SV_Target
|
||||
{
|
||||
half4 color = (tex2D(_MainTex, IN.texcoord) + _TextureSampleAdd) * IN.color;
|
||||
|
||||
|
||||
// Do we want to clip the image to the Mask Rectangle?
|
||||
if (IN.worldPosition2.x <= _Min.x || IN.worldPosition2.x >= _Max.x || IN.worldPosition2.y <= _Min.y || IN.worldPosition2.y >= _Max.y)
|
||||
color.a = 0;
|
||||
else // It's in the mask rectangle, so apply the alpha of the mask provided.
|
||||
{
|
||||
float a = tex2D(_AlphaMask, (IN.worldPosition2.xy - _Max) / (_Max-_Min)).a;
|
||||
if (a <= _CutOff)
|
||||
a = 0;
|
||||
else
|
||||
{
|
||||
if (_HardBlend)
|
||||
a = 1;
|
||||
}
|
||||
|
||||
color.a = a * color.a;
|
||||
}
|
||||
|
||||
if (_UseClipRect)
|
||||
color *= UnityGet2DClipping(IN.worldPosition.xy, _ClipRect);
|
||||
|
||||
if (_UseAlphaClip)
|
||||
clip(color.a - 0.001);
|
||||
|
||||
return color;
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
fileFormatVersion: 2
|
||||
guid: abe89b015c410b54db04a4842127ae9e
|
||||
timeCreated: 1445628990
|
||||
licenseType: Pro
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,67 @@
|
|||
/// Credit 00christian00
|
||||
/// Sourced from - http://forum.unity3d.com/threads/any-way-to-show-part-of-an-image-without-using-mask.360085/#post-2332030
|
||||
|
||||
Shader "UI Extensions/UI Image Crop" {
|
||||
Properties
|
||||
{
|
||||
_MainTex ("Base (RGB)", 2D) = "white" {}
|
||||
|
||||
_XCrop ("X Crop", Range(0.0,1.0)) = 1
|
||||
_YCrop ("Y Crop", Range(0.0,1.0)) = 1
|
||||
}
|
||||
|
||||
SubShader {
|
||||
|
||||
ZWrite Off
|
||||
Tags
|
||||
{
|
||||
"Queue" = "Transparent"
|
||||
"RenderType" = "Transparent"
|
||||
"IgnoreProjector" = "True"
|
||||
}
|
||||
Blend SrcAlpha OneMinusSrcAlpha
|
||||
|
||||
Pass {
|
||||
|
||||
CGPROGRAM
|
||||
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
struct v2f {
|
||||
float4 pos : POSITION;
|
||||
fixed4 color : COLOR;
|
||||
float2 uv : TEXCOORD0; //UV1 coord
|
||||
};
|
||||
|
||||
uniform sampler2D _MainTex;
|
||||
float4 _MainTex_ST;
|
||||
uniform float _XCrop;
|
||||
uniform float _YCrop;
|
||||
|
||||
v2f vert (v2f v)
|
||||
{
|
||||
|
||||
v2f o;
|
||||
o.color=v.color;
|
||||
o.color.a=0.1;
|
||||
o.pos = mul (UNITY_MATRIX_MVP, v.pos);
|
||||
|
||||
o.uv=TRANSFORM_TEX(v.uv, _MainTex);
|
||||
|
||||
return o;
|
||||
}
|
||||
fixed4 frag (v2f i) : COLOR
|
||||
{
|
||||
|
||||
//return fixed4(0.25,0,0,1);
|
||||
i.color.a=step(i.uv.x,_XCrop);
|
||||
//I don't like the bottom up ordering,so I reverse it
|
||||
i.color.a=i.color.a*step(1-i.uv.y,_YCrop);
|
||||
return i.color * tex2D (_MainTex, i.uv);
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
fileFormatVersion: 2
|
||||
guid: ccf5a0c8f87d3c547aff3daecb3164a4
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
13
package.json
13
package.json
|
@ -1,11 +1,11 @@
|
|||
{
|
||||
"name": "Unity UI Extensions",
|
||||
"version": "1.0.5",
|
||||
"version": "1.0.6",
|
||||
"description": "An extension project for the Unity3D UI system, all crafted and contributed by the awesome Unity community",
|
||||
"author": "Simon darkside Jackson <@SimonDarksideJ>",
|
||||
"contributors": [{
|
||||
"name": "Foo Bar",
|
||||
"email": "foo.bar@example.com"
|
||||
"name": "SimonDarksideJ",
|
||||
"twitter": "@SimonDarksideJ"
|
||||
}],
|
||||
"repository": {
|
||||
"type": "hg",
|
||||
|
@ -15,9 +15,10 @@
|
|||
"url": "https://bitbucket.org/ddreaper/unity-ui-extensions/issues"
|
||||
},
|
||||
"keywords": [
|
||||
"nodejitsu",
|
||||
"example",
|
||||
"browsenpm"
|
||||
"Unity3D",
|
||||
"Unity",
|
||||
"Unity UI",
|
||||
"UI Extensions"
|
||||
],
|
||||
"license": "BSD"
|
||||
}
|
Loading…
Reference in New Issue