Simple Unity UI animation tool!
For moving UI elements attach XyzUITransition.cs to your object:
XyzUITransition is a MonoBehaviour script in Unity that manages the transition of a UI element between two points. It provides options to auto-run the transition on Awake(), set the start position, and hide the object after the transition is done.
- Auto Run: If autoRun is set to true, the transition will start automatically on Awake().
- Delay To Start: You can set a delay before the transition starts using delayToStart.
- Speed Of Transition: The speed of the transition can be controlled using speedOfTransition.
- Set Start Position: If setStartPosition is true, the current position of the RectTransform will be set to firstPosition before the transition starts.
- Hide After Done: If hideAfterDone is true, the game object will be set to inactive after the transition is done.
- Attach the XyzUITransition script to the game object you want to animate.
- In the inspector, set the firstPosition and secondPosition for the transition.
- Set the speedOfTransition and delayToStart as per your requirements.
- If you want the transition to start automatically on Awake(), set autoRun to true.
- If you want the game object to start at firstPosition, set setStartPosition to true.
- If you want the game object to be hidden after the transition, set hideAfterDone to true.
- StartTransition(string newPos) Starts the transition manually.
- newPos: Pass an empty string for normal transition, 'D' to hide after completion.
Do not modify the worker variable as it is used internally to manage the transition.
for changing color of UI elements attach XyzImageFading.cs or XyzSpriteFading.cs or XyzTextFading.cs to your object:
XyzImageFading is a MonoBehaviour script in Unity that manages the fading of an image between two colors.
- Auto Run: If autoRun is set to true, the fading will start automatically on Awake().
- Delay To Start: You can set a delay before the fading starts using delayToStart.
- Speed Of Fading: The speed of the fading can be controlled using speedOfFading.
- Set Start Color: If setStartColor is true, the color of the Image will be set to xColor before the fading starts.
- Hide After Done: If hideAfterDone is true, the game object will be set to inactive after the fading is done.
- Attach the XyzImageFading script to the game object you want to animate.
- In the inspector, set the xColor and yColor for the fading.
- Set the speedOfFading and delayToStart as per your requirements.
- If you want the fading to start automatically on Awake(), set autoRun to true.
- If you want the game object to start at xColor, set setStartColor to true.
- If you want the game object to be hidden after the fading, set hideAfterDone to true.
- Awake(): Checks if autoRun is true. If so, it sets the start color and starts the fading after a delay.
- StartFading(string input): Starts the fading. The input is a string containing one or two HTML color codes separated by a comma. If there is one color code, it sets yColor to that color. If there are two color codes, it sets yColor to the first color and xColor to the second color.
Do not modify the worker variable as it is used internally to manage the fading.
- Fork the repository and clone it locally.
- Create a new branch for your feature: git checkout -b feature-name
- Commit your changes: git commit -m 'Add new feature'
- Push to the branch: git push origin feature-name
- Submit a pull request.
This project is licensed under the MIT License.
For inquiries, please contact me at [[email protected]].