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.
57 lines
1.4 KiB
57 lines
1.4 KiB
using System;
|
|
using UnityEngine;
|
|
|
|
namespace FX
|
|
{
|
|
// Token: 0x0200075B RID: 1883
|
|
public class FX_CopyMat_SetParamCurve : MonoBehaviour
|
|
{
|
|
// Token: 0x0600302D RID: 12333 RVA: 0x00102628 File Offset: 0x00102628
|
|
private void Start()
|
|
{
|
|
Renderer component = base.GetComponent<Renderer>();
|
|
this._material = ((!(component != null)) ? null : component.material);
|
|
this._propertyID_ValueName = Shader.PropertyToID(this._valueName);
|
|
}
|
|
|
|
// Token: 0x0600302E RID: 12334 RVA: 0x0010266C File Offset: 0x0010266C
|
|
private void Update()
|
|
{
|
|
if (this._material != null)
|
|
{
|
|
float value = this._keyValueMagnification * this.CurveX.Evaluate(this.duration);
|
|
this._material.SetFloat(this._propertyID_ValueName, value);
|
|
}
|
|
this.duration += Time.deltaTime / this._keyTimeMagnification;
|
|
}
|
|
|
|
// Token: 0x04005607 RID: 22023
|
|
[SerializeField]
|
|
private string _valueName = "_Opacity";
|
|
|
|
// Token: 0x04005608 RID: 22024
|
|
[SerializeField]
|
|
private float _keyValueMagnification = 1f;
|
|
|
|
// Token: 0x04005609 RID: 22025
|
|
[SerializeField]
|
|
private float _keyTimeMagnification = 1f;
|
|
|
|
// Token: 0x0400560A RID: 22026
|
|
private float duration;
|
|
|
|
// Token: 0x0400560B RID: 22027
|
|
public AnimationCurve CurveX = new AnimationCurve(new Keyframe[]
|
|
{
|
|
new Keyframe(0f, 0f, 3f, 3f),
|
|
new Keyframe(1f, 1f)
|
|
});
|
|
|
|
// Token: 0x0400560C RID: 22028
|
|
private Material _material;
|
|
|
|
// Token: 0x0400560D RID: 22029
|
|
private int _propertyID_ValueName;
|
|
}
|
|
}
|