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.
58 lines
1.6 KiB
58 lines
1.6 KiB
using System;
|
|
using UnityEngine;
|
|
|
|
namespace FX
|
|
{
|
|
// Token: 0x02000762 RID: 1890
|
|
public class FX_UVAnimation : MonoBehaviour
|
|
{
|
|
// Token: 0x0600303F RID: 12351 RVA: 0x00102998 File Offset: 0x00102998
|
|
public void Start()
|
|
{
|
|
this.thisMaterial = base.GetComponent<Renderer>().material;
|
|
}
|
|
|
|
// Token: 0x06003040 RID: 12352 RVA: 0x001029AC File Offset: 0x001029AC
|
|
public void Update()
|
|
{
|
|
this.rate = (this.timeCount - this._timeToStart) / this._timeToGoal;
|
|
this.rate = Mathf.Clamp(this.rate, 0f, 1f);
|
|
this.resultUV = this._startUVOffset + (this._goalUVOffset - this._startUVOffset) * this.rate;
|
|
this.thisMaterial.SetTextureOffset("_MainTex", this.resultUV);
|
|
this.timeCount += Time.deltaTime;
|
|
}
|
|
|
|
// Token: 0x0400561D RID: 22045
|
|
[Tooltip("アニメーション開始時のUVオフセット")]
|
|
[SerializeField]
|
|
private Vector2 _startUVOffset;
|
|
|
|
// Token: 0x0400561E RID: 22046
|
|
[Tooltip("アニメーション終了時のUVオフセット")]
|
|
[SerializeField]
|
|
private Vector2 _goalUVOffset;
|
|
|
|
// Token: 0x0400561F RID: 22047
|
|
[Tooltip("アニメーション開始までのウェイト(秒数)")]
|
|
[SerializeField]
|
|
private float _timeToStart;
|
|
|
|
// Token: 0x04005620 RID: 22048
|
|
[Tooltip("アニメーション開始から終了までの長さ(秒数)")]
|
|
[SerializeField]
|
|
private float _timeToGoal;
|
|
|
|
// Token: 0x04005621 RID: 22049
|
|
private Vector2 resultUV;
|
|
|
|
// Token: 0x04005622 RID: 22050
|
|
private Material thisMaterial;
|
|
|
|
// Token: 0x04005623 RID: 22051
|
|
private float timeCount;
|
|
|
|
// Token: 0x04005624 RID: 22052
|
|
private float rate;
|
|
}
|
|
}
|