]> git.bts.cx Git - jurassic-tween.git/blob - README.md
Updated licence and some notes on the readme
[jurassic-tween.git] / README.md
1 # JurassicTween
2
3 > Your scientists were so preoccupied with whether or not they could (tween like that) they didn’t stop to think if they should.
4
5 🚨 This is a preview only. I advise against shipping this. 🚨
6
7 ## What?
8
9 JurassicTween is a Unity3D tweening library designed for:
10
11 * Tweening values on `Component` objects...
12 * ...in a very simple way...
13 * ...favoring ease of prototyping over performance (for now).
14
15 ## How?
16
17 Add JurassicTween to a project. Making a tween is super easy, here's how you would make an object randomly move, rotate and scale onscreen:
18
19 ```
20 using JurassicTween;
21 using UnityEngine;
22
23 public class MoveMe : MonoBehaviour {
24     void Update() {
25         if (gameObject.IsTweening() == false) {
26             using (transform.Tween()) {
27                 transform.position = Random.insideUnitSphere * 10.0f;
28                 transform.rotation = Quaternion.Euler(0, 0, Random.Range(0.0f, 360.0f));
29                 transform.localScale = Vector3.one * Random.Range(0.1f, 2.0f);
30             }
31             // using (anyOtherComponent.Tween()) {
32                 // These chain together, and your own MonoBehavior components should also work...
33             // }
34         }
35     }
36 }
37 ```
38
39 Basically, the tween breaks down as follows:
40
41 * Mark a game component as requiring a tween using `Component.Tween()`
42 * Set the fields on the component that you want to target
43 * The tween will then be set up to be from the current values to the target values you set.
44
45 The tweens themselves are performed on a component, and you can check if a game object currently has any active tweens.
46
47 **VERY IMPORTANT:** Not everything will work correctly, especially Unity's native components. (Transform is an exception, we've fixed that.)
48
49 ## Roadmap
50
51 This is a preview release only. There are bugs. Lots of things won't work.
52
53 Currently the following features are supported:
54
55 * Some things tween
56 * You can give a duration of tween
57 * The curve of the tweens can be set, and you can use an AnimationCurve to design your own.
58
59 # Licence
60
61 Public domain, no warranty etc.
62
63