-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTweenEquation.cs
More file actions
40 lines (33 loc) · 923 Bytes
/
TweenEquation.cs
File metadata and controls
40 lines (33 loc) · 923 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
using System;
namespace TweenEngine
{
/**
* Base class for every easing equations. You can create your own equations
* and directly use them in the tween static methods by deriving from this
* class
*/
public abstract class TweenEquation
{
public TweenEquation()
{
}
protected String TweenName;
/**
* Computes the next value of the interpolation
* @param t Current time, in seconds
* @param b Initial value
* @param c Offset to the inital value
* @param d Total duration, in seconds
*/
public abstract float Compute(float t, float b, float c, float d);
/**
* Returns true if the given string is the name of the equation (the name
* is returned in the ToString() method, don't forget to override it).
* This method is usually used to save/ load a tween to/from a text file
*/
public bool IsValueOf (String str)
{
return str.Equals(TweenName);
}
}
}