A library for juicing Unity3D sprites, models, UI elements, shaders, and more.
Comprehensive API documentation can be found here
1. Download the Juice.cs file and throw it wherever you'd like in your assets folder
2. Attach Juice.cs as a component to any gameobject that won't be destroyed (such as GameManager). Juice is a singleton.
3. Call the library in any script anywhere (not just on that GameObject) via Juice.Instance.[JuiceMethodName]
4. Enjoy one-line tweens, fades, and color lerps!
The following will move 'myRect' 5 units up and 6 units to the left in exactly 1 second, linearly. After completing, it will print a debug statement
Juice.Instance.Tween(myRect, 1f, new Vector2(-6,5),Juice.Instance.Linear, ()=>{
Debug.Log("All done!");
});
The following will fade out a CanvasGroup linearly, regardless of it's current alpha
Juice.Instance.FadeGroup(myGroup, 0.5f, 0.0f)
The following animations from easings.net are included. Please note that any animations on that page that go outside the bounds of (0,1) are not enabled in Juice at this time.
Please raise an issue for feature requests, and a PR into master for any contributions with the following:
- Summary of changes
- How to test (convince me this won't break existing Juice implementations)