EasyTalk API
|
The UIAnimator can be used to animate UI components with fading or sliding animations. More...
Public Types | |
enum | SlideDirection { NONE , LEFT , RIGHT , UP , DOWN } |
An enum of possible slide animation directions. More... | |
enum | Animation { NONE , SLIDE_LEFT , SLIDE_RIGHT , SLIDE_UP , SLIDE_DOWN , FADE } |
An enum of supported animation types. More... | |
Static Public Member Functions | |
static bool | IsItemAnimating (int id) |
Returns true if the specified UI element is currently being animated. | |
static bool | IsItemAnimating (GameObject gameObject) |
Returns true if the specified GameObject is currently being animated. | |
static IEnumerator | FadeText (Text text, float duration, float finalAlpha, AnimationCurve curve=null) |
Fades text to a specified alpha value over the specified time period. | |
static void | FadeTextImmediately (Text text, float finalAlpha) |
Fade text to a specified alpha value immediately. | |
static IEnumerator | FadeTextIn (Text text, float duration, AnimationCurve curve=null) |
Fade text in to its original alpha value. (This assumes that the original alpha value is stored) | |
static void | FadeTextInImmediately (Text text) |
Fades text in to its original alpha value immediately. | |
static IEnumerator | FadeTextOut (Text text, float duration, AnimationCurve curve=null) |
Fades text out to be completely transparent over a specified duration. | |
static void | FadeTextOutImmediately (Text text) |
Fades text out to be completely transparent immediately. | |
static IEnumerator | FadeImage (Image image, float duration, float finalAlpha, AnimationCurve curve=null) |
Fades an image to a specified alpha value over time. | |
static void | FadeImageImmediately (Image image, float finalAlpha) |
Fades an image to the specified alpha value immediately. | |
static IEnumerator | FadeImageIn (Image image, float duration, AnimationCurve curve=null) |
Fades an image in to its original alpha value. (This assumes that the original alpha value is stored) | |
static void | FadeImageInImmediately (Image image) |
Fades an image in to its stored alpha value immediately. | |
static IEnumerator | FadeImageOut (Image image, float duration, AnimationCurve curve=null) |
Fades an image out to be completely transparent over a specified duration. | |
static void | FadeImageOutImmediately (Image image) |
Fades an image out to be completely transparent immediately. | |
static IEnumerator | Fade (GameObject gameObject, float duration, float finalAlpha, AnimationCurve curve=null) |
Fades all text and image components which are components of, or child components of the specified GameObject to an alpha value over a specified duration. | |
static void | FadeImmediately (GameObject gameObject, float finalAlpha) |
Immediately fades all text and image elements which are components of, or child components of the specified GameObject to the specified alpha value. | |
static void | ClearStoredAlpha (int instanceID) |
Clears the stored alpha values for the specified instance ID. | |
static void | ClearStoredAlphas (GameObject gameObject) |
Clears the stored alpha values for all components and child components of the specified GameObject. | |
static void | ClearAllStoredAlphas () |
Clears all stored alpha values. | |
static IEnumerator | FadeIn (GameObject gameObject, float duration, AnimationCurve curve=null) |
Fades in the components and child components of the specified GameObject to their original stored alpha values over the specified duration. | |
static void | FadeInImmediately (GameObject gameObject) |
Fades in all text and image components and child components of the specified GameObject to their original stored alpha values immediately. | |
static IEnumerator | FadeOut (GameObject gameObject, float duration, AnimationCurve curve=null) |
Fades out all text and image components and child components of the specified GameObject to be completely transparent over the specified duration. | |
static void | FadeOutImmediately (GameObject gameObject) |
Fades out all text and image components and child components of the specified GameObject to be completely transparent immediately. | |
static void | StoreOriginalOpacities (GameObject gameObject) |
Stores opacity values for each text and image component in the specified GameObject. | |
static IEnumerator | SlideInComponent (Canvas canvas, RectTransform transform, float duration, AnimationCurve curve=null, float margin=0.0f) |
Slides the specified RectTransform into a Canvas' bounds over a specified period of time. | |
static void | SlideInComponentImmediately (Canvas canvas, RectTransform transform, float margin=0.0f) |
Slides the specified RectTransform into a Canvas' bounds immediately. | |
static IEnumerator | SlideOutComponent (Canvas canvas, RectTransform transform, SlideDirection direction, float duration, AnimationCurve curve=null) |
Slides the specified RectTransform out of a Canvas' bounds over a specified period of time. | |
static void | SlideOutComponentImmediately (Canvas canvas, RectTransform transform, SlideDirection direction) |
Slides the specified RectTransform out of a Canvas' bounds immediately. | |
static IEnumerator | SlideComponentToPosition (RectTransform transform, Vector3 newPos, float duration, AnimationCurve curve=null) |
Slides the specified RectTransform to a position over the specified duration. | |
static void | SlideComponentToPositionImmediately (RectTransform transform, Vector3 newPos) |
Slides the specified RectTransform to a position immediately. | |
static UIAnimator.SlideDirection | GetSlideDirection (UIAnimator.Animation animation) |
Returns the corresponding SlideDirection associated with the specified Animation type. | |
Static Public Attributes | |
static Dictionary< int, int > | itemsAnimationCounter = new Dictionary<int, int>() |
Mapping used to keep track of the number of animations running for a given UI element. | |
Static Private Member Functions | |
static void | StartingItemAnimation (int id) |
Increments the running animation counter for the specified ID. | |
static void | FinishedItemAnimation (int id) |
Decrements the running animation counter for the specified ID. | |
static float | GetOriginalOpacity (int instanceId) |
Returns the original opacity value which is stored for the specified instance ID, or a value of 1.0 if no stored value is found. | |
static void | StoreOriginalOpacity (Object obj, float opacity) |
Stores an opacity value for the specified object instance. | |
static Vector3 | FindPositionToHide (Canvas canvas, RectTransform transform, SlideDirection direction) |
Calculates the position to move the specified RectTransform to in order for it to be hidden and outside of the Canvas provided. | |
static Vector3 | FindPositionToShow (Canvas canvas, RectTransform transform, float margin=0.0f) |
Calculates the position to move the specified RectTransform to in order for it to be shown inside the Canvas provided. | |
Static Private Attributes | |
static Dictionary< int, float > | storedElementAlphas = new Dictionary<int, float>() |
A mapping of component instance IDs to the original alpha values of various UI elements. | |
The UIAnimator can be used to animate UI components with fading or sliding animations.
|
static |
Clears all stored alpha values.
|
static |
Clears the stored alpha values for the specified instance ID.
instanceID | The instance ID of the component or GameObject to clear. |
|
static |
Clears the stored alpha values for all components and child components of the specified GameObject.
gameObject | The GameObject to clear stored alpha values for. |
|
static |
Fades all text and image components which are components of, or child components of the specified GameObject to an alpha value over a specified duration.
gameObject | The GameObject to fade. |
duration | The duration of the fade animation, in seconds. |
finalAlpha | The final desired alpha value for the components being faded. |
curve | An animation curve used to control the animation timing. |
|
static |
Fades an image to a specified alpha value over time.
image | The image to animate. |
duration | The duration of the fade animation, in seconds. |
finalAlpha | The final alpha value to fade to. |
curve | An animation curve used to control the animation timing. |
|
static |
Fades an image to the specified alpha value immediately.
image | The image to fade. |
finalAlpha | The final alpha value to use. |
|
static |
Fades an image in to its original alpha value. (This assumes that the original alpha value is stored)
image | The image to fade in. |
duration | The duration of the fade in animation, in seconds. |
curve | The animation curve used to control the animation timing. |
|
static |
Fades an image in to its stored alpha value immediately.
image | The image to fade in. |
|
static |
Fades an image out to be completely transparent over a specified duration.
image | The image to fade out. |
duration | The duration of the animation in seconds. |
curve | An animation curve used to control the animation timing. |
|
static |
Fades an image out to be completely transparent immediately.
image | The image to make transparent. |
|
static |
Immediately fades all text and image elements which are components of, or child components of the specified GameObject to the specified alpha value.
gameObject | The GameObject to fade. |
finalAlpha | The final desired alpha value. |
|
static |
Fades in the components and child components of the specified GameObject to their original stored alpha values over the specified duration.
gameObject | The GameObject to fade in. |
duration | The duration of the fade in animation, in seconds. |
curve | An animation curve used to control the animation timing. |
|
static |
Fades in all text and image components and child components of the specified GameObject to their original stored alpha values immediately.
gameObject | The GameObject to fade in. |
|
static |
Fades out all text and image components and child components of the specified GameObject to be completely transparent over the specified duration.
gameObject | The GameObject to fade out. |
duration | The duration of the fade out animation, in seconds. |
curve | An animation curve used to control the animation timing. |
|
static |
Fades out all text and image components and child components of the specified GameObject to be completely transparent immediately.
gameObject | The GameObject to fade out. |
|
static |
Fades text to a specified alpha value over the specified time period.
text | The text element to animate the alpha value of. |
duration | The duration, in seconds, to spend animating the text. |
finalAlpha | The final alpha value desired for the text. |
curve | An animation curve controlling how quickly the text is faded. |
|
static |
Fade text to a specified alpha value immediately.
text | The text element to fade. |
finalAlpha | The final alpha value. |
|
static |
Fade text in to its original alpha value. (This assumes that the original alpha value is stored)
text | The text element to fade in. |
duration | The duration of the fade in animation in seconds. |
curve | The animation curve used to control the animation timing. |
|
static |
Fades text in to its original alpha value immediately.
text | The text element to fade in. |
|
static |
Fades text out to be completely transparent over a specified duration.
text | The text element to fade out. |
duration | The duration of the animation, in seconds. |
curve | The animation curve used to control the animation timing. |
|
static |
Fades text out to be completely transparent immediately.
text | The text element to fade out. |
|
staticprivate |
Calculates the position to move the specified RectTransform to in order for it to be hidden and outside of the Canvas provided.
canvas | The Canvas which the RectTransform should be hidden in. |
transform | The RectTransform to hide. |
direction | The direction to slide the RectTransform in when hiding it. |
|
staticprivate |
Calculates the position to move the specified RectTransform to in order for it to be shown inside the Canvas provided.
canvas | The Canvas which the RectTransform should be shown in. |
transform | The RectTransform to show. |
margin | An option margin offset. |
|
staticprivate |
Decrements the running animation counter for the specified ID.
id | The isntance ID of the object an animation is ending on. |
|
staticprivate |
Returns the original opacity value which is stored for the specified instance ID, or a value of 1.0 if no stored value is found.
instanceId | The instance ID to retrieve a stored opacity value for. |
|
static |
Returns the corresponding SlideDirection associated with the specified Animation type.
animation | The animation type to get a slide direction for. |
|
static |
Returns true if the specified GameObject is currently being animated.
gameObject | The GameObject to check. |
|
static |
Returns true if the specified UI element is currently being animated.
id | The instance ID of the UI element to check. |
|
static |
Slides the specified RectTransform to a position over the specified duration.
transform | The RectTransform to slide. |
newPos | The position to move the RectTransform to. |
duration | The duration of the animation. |
curve | An animation curve used to control the animation timing. |
|
static |
Slides the specified RectTransform to a position immediately.
transform | The RectTransform to slide. |
newPos | The position to move the RectTransform to. |
|
static |
Slides the specified RectTransform into a Canvas' bounds over a specified period of time.
canvas | The Canvas which the transform should slide into. |
transform | The RectTransform of the component to slide in. |
duration | The duration of the slide animation. |
curve | An animation curve used to control the animation timing. |
margin | An optional additional margin offset for the final slide in position. |
|
static |
Slides the specified RectTransform into a Canvas' bounds immediately.
canvas | The Canvas which the transform should slide into. |
transform | The RectTransform of the component to slide in. |
margin | An optional additional margin offset for the final slide in position. |
|
static |
Slides the specified RectTransform out of a Canvas' bounds over a specified period of time.
canvas | The Canvas which the transform should slide out of. |
transform | The RectTransform of the component to slide out. |
direction | The direction that the component should slide out. |
duration | The duration of the animation, in seconds. |
curve | An animation curve used to control the animation timing. |
|
static |
Slides the specified RectTransform out of a Canvas' bounds immediately.
canvas | The Canvas which the transform should slide out of. |
transform | The RectTransform of the component to slide out. |
direction | The direction that the component should slide out. |
|
staticprivate |
Increments the running animation counter for the specified ID.
id | The instance ID of the object an animation is starting on. |
|
static |
Stores opacity values for each text and image component in the specified GameObject.
gameObject | The GameObject to store opacity values of. |
|
staticprivate |
Stores an opacity value for the specified object instance.
obj | The object to store an opacity value of. |
opacity | The opacity value to store. |
|
static |
Mapping used to keep track of the number of animations running for a given UI element.
|
staticprivate |
A mapping of component instance IDs to the original alpha values of various UI elements.