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.
|
|
|
|
using System;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
|
|
namespace FX
|
|
|
|
|
{
|
|
|
|
|
// Token: 0x0200075C RID: 1884
|
|
|
|
|
public class FX_CopyMat_SetParam_ByScale : MonoBehaviour
|
|
|
|
|
{
|
|
|
|
|
// Token: 0x06003030 RID: 12336 RVA: 0x001026E4 File Offset: 0x001026E4
|
|
|
|
|
private void Start()
|
|
|
|
|
{
|
|
|
|
|
Renderer component = base.GetComponent<Renderer>();
|
|
|
|
|
this._materials = ((!(component != null)) ? null : component.materials);
|
|
|
|
|
this._propertyID_ValueName = Shader.PropertyToID(this.valueName);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Token: 0x06003031 RID: 12337 RVA: 0x00102728 File Offset: 0x00102728
|
|
|
|
|
private void Update()
|
|
|
|
|
{
|
|
|
|
|
if (this._materials.Length != 0)
|
|
|
|
|
{
|
|
|
|
|
for (int i = this._materials.Length - 1; i >= 0; i--)
|
|
|
|
|
{
|
|
|
|
|
this._materials[i].SetFloat(this._propertyID_ValueName, base.transform.lossyScale.x);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Token: 0x0400560E RID: 22030
|
|
|
|
|
[SerializeField]
|
|
|
|
|
private string valueName = "_Opacity";
|
|
|
|
|
|
|
|
|
|
// Token: 0x0400560F RID: 22031
|
|
|
|
|
private Material _material;
|
|
|
|
|
|
|
|
|
|
// Token: 0x04005610 RID: 22032
|
|
|
|
|
private Material[] _materials;
|
|
|
|
|
|
|
|
|
|
// Token: 0x04005611 RID: 22033
|
|
|
|
|
private int _propertyID_ValueName;
|
|
|
|
|
}
|
|
|
|
|
}
|