]> git.bts.cx Git - jurassic-tween.git/blob - Scripts/Runtime/Tween.cs
Updated licence and some notes on the readme
[jurassic-tween.git] / Scripts / Runtime / Tween.cs
1 //
2 // Tween.cs
3 // JurassicTween
4 //
5 // Created by Benjamin Sherratt on 04/05/2021.
6 // Copyright © 2021 SKFX Ltd. All rights reserved.
7 //\r
8 \r
9 using JurassicTween.Internal;\r
10 using System;\r
11 using UnityEngine;
12
13 namespace JurassicTween {
14     public static class JurassicTween {
15         public static IDisposable Tween(this Component component, float time = 1.0f) {
16             return component.Tween(time, TweenParameters.linear);
17         }
18
19         public static IDisposable Tween(this Component component, float time, TweenParameters tweenParameters) {
20             Context context = new Context(component, time, tweenParameters);
21             return context;
22         }
23
24         public static bool IsTweening(this GameObject gameObject) {
25             Animation animation = gameObject.GetComponent<Animation>();
26             bool tweening = ((animation != null) && animation.isPlaying);
27             return tweening;
28         }
29     }
30 }