You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
60 lines
1.5 KiB
60 lines
1.5 KiB
using System;
|
|
using UnityEngine;
|
|
|
|
namespace FX
|
|
{
|
|
// Token: 0x0200074A RID: 1866
|
|
public class FX_RotationCurve : MonoBehaviour
|
|
{
|
|
// Token: 0x06003000 RID: 12288 RVA: 0x00101618 File Offset: 0x00101618
|
|
private void Update()
|
|
{
|
|
float x = this.keyValueMagnification * this.CurveX.Evaluate(this.duration);
|
|
float y = this.keyValueMagnification * this.CurveY.Evaluate(this.duration);
|
|
float z = this.keyValueMagnification * this.CurveZ.Evaluate(this.duration);
|
|
this.animState = new Vector3(x, y, z);
|
|
base.transform.Rotate(this.animState - this.preState);
|
|
this.preState = this.animState;
|
|
this.duration += Time.deltaTime / this.keyTimeMagnification;
|
|
}
|
|
|
|
// Token: 0x040055A2 RID: 21922
|
|
[SerializeField]
|
|
private float keyValueMagnification = 1f;
|
|
|
|
// Token: 0x040055A3 RID: 21923
|
|
[SerializeField]
|
|
private float keyTimeMagnification = 1f;
|
|
|
|
// Token: 0x040055A4 RID: 21924
|
|
private float duration;
|
|
|
|
// Token: 0x040055A5 RID: 21925
|
|
private Vector3 preState = new Vector3(0f, 0f, 0f);
|
|
|
|
// Token: 0x040055A6 RID: 21926
|
|
private Vector3 animState;
|
|
|
|
// Token: 0x040055A7 RID: 21927
|
|
public AnimationCurve CurveX = new AnimationCurve(new Keyframe[]
|
|
{
|
|
new Keyframe(0f, 0f),
|
|
new Keyframe(0f, 0f)
|
|
});
|
|
|
|
// Token: 0x040055A8 RID: 21928
|
|
public AnimationCurve CurveY = new AnimationCurve(new Keyframe[]
|
|
{
|
|
new Keyframe(0f, 0f),
|
|
new Keyframe(0f, 0f)
|
|
});
|
|
|
|
// Token: 0x040055A9 RID: 21929
|
|
public AnimationCurve CurveZ = new AnimationCurve(new Keyframe[]
|
|
{
|
|
new Keyframe(0f, 0f),
|
|
new Keyframe(0f, 0f)
|
|
});
|
|
}
|
|
}
|