A UI screen system for Unity. The main purpose is to animate screens opening and closing.
Developed and tested with Unity 2020.3.16f1
- Open Package Manager through Window/Package Manager
- Click "+" and choose "Add package from git URL..."
- Insert the URL: https://github.com/Delt06/ui-framework.git?path=Packages/com.deltation.ui-framework
Add the following line to Packages/manifest.json
:
"com.deltation.ui-framework": "https://github.com/Delt06/ui-framework.git?path=Packages/com.deltation.ui-framework",
If you need to use the plugin in an assembly definition, make sure to add a reference to DELTation.UI
.
To create your first screen:
- On a canvas, create a
GameObject
and attachGameScreen
component to it. - Attach open/close animations to the child object if required.
- Call
Open()
/Close()
on the screen object.
In the plugins, there is a number of animation components available. Each of them allows defining the keyframes for screen to be open and closed. Also, to configure how fast the animation should be played.
For now, the following animations are implemented:
ScreenAnchoredPositionAnimation
for anchored positionScreenCanvasGroupAlphaAnimation
for alpha ofCanvasGroup
ScreenGrapicAlphaAnimation
for alpha ofGraphic
-based components (e.g.Image
)ScreenLocalRotationAnimation
for local rotationScreenScaleAnimation
for local scale
For each of two states (open and closed) the following parameters are available:
Delay
for transition delayDuration
for actual duration of transitionsEase
for easing functionOvershoot
for overshoot value of easing function
The plugin has an integration with UniTask.
It must be referenced as a separate assembly definition - DELTation.UI.UniTaskSupport
.
For supported operations, see AsyncUiExtensions
.