|
|
|
|
using System;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
|
|
namespace FX
|
|
|
|
|
{
|
|
|
|
|
// Token: 0x02000751 RID: 1873
|
|
|
|
|
public class FX_CopyAndShareMat_SetParam2 : MonoBehaviour
|
|
|
|
|
{
|
|
|
|
|
// Token: 0x06003012 RID: 12306 RVA: 0x00101D2C File Offset: 0x00101D2C
|
|
|
|
|
private void Start()
|
|
|
|
|
{
|
|
|
|
|
foreach (Renderer renderer in this._renderers)
|
|
|
|
|
{
|
|
|
|
|
if (renderer != null && renderer.material != null)
|
|
|
|
|
{
|
|
|
|
|
if (this._sharedMaterial == null)
|
|
|
|
|
{
|
|
|
|
|
this._sharedMaterial = new Material(renderer.material);
|
|
|
|
|
}
|
|
|
|
|
renderer.material = this._sharedMaterial;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this._propertyID_ValueName1 = Shader.PropertyToID(this.valueName1);
|
|
|
|
|
this._propertyID_ValueName2 = Shader.PropertyToID(this.valueName2);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Token: 0x06003013 RID: 12307 RVA: 0x00101DC8 File Offset: 0x00101DC8
|
|
|
|
|
private void Update()
|
|
|
|
|
{
|
|
|
|
|
if (this._sharedMaterial != null)
|
|
|
|
|
{
|
|
|
|
|
this._sharedMaterial.SetFloat(this._propertyID_ValueName1, this.value1);
|
|
|
|
|
this._sharedMaterial.SetFloat(this._propertyID_ValueName2, this.value2);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Token: 0x040055C7 RID: 21959
|
|
|
|
|
[SerializeField]
|
|
|
|
|
private string valueName1 = "_Exposure";
|
|
|
|
|
|
|
|
|
|
// Token: 0x040055C8 RID: 21960
|
|
|
|
|
[SerializeField]
|
|
|
|
|
private float value1;
|
|
|
|
|
|
|
|
|
|
// Token: 0x040055C9 RID: 21961
|
|
|
|
|
[SerializeField]
|
|
|
|
|
private string valueName2 = "_Opacity";
|
|
|
|
|
|
|
|
|
|
// Token: 0x040055CA RID: 21962
|
|
|
|
|
[SerializeField]
|
|
|
|
|
private float value2;
|
|
|
|
|
|
|
|
|
|
// Token: 0x040055CB RID: 21963
|
|
|
|
|
[SerializeField]
|
|
|
|
|
private Renderer[] _renderers;
|
|
|
|
|
|
|
|
|
|
// Token: 0x040055CC RID: 21964
|
|
|
|
|
private Material _sharedMaterial;
|
|
|
|
|
|
|
|
|
|
// Token: 0x040055CD RID: 21965
|
|
|
|
|
private int _propertyID_ValueName1;
|
|
|
|
|
|
|
|
|
|
// Token: 0x040055CE RID: 21966
|
|
|
|
|
private int _propertyID_ValueName2;
|
|
|
|
|
}
|
|
|
|
|
}
|