using System; using UnityEngine; namespace FX { // Token: 0x02000753 RID: 1875 public class FX_CopyAndShareMat_UVAdd : MonoBehaviour { // Token: 0x06003018 RID: 12312 RVA: 0x00101F64 File Offset: 0x00101F64 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; } } if (this._sharedMaterial != null) { this._sharedMaterial.SetTextureOffset(this.TextureName, Vector2.zero); } } // Token: 0x06003019 RID: 12313 RVA: 0x00102004 File Offset: 0x00102004 private void Update() { if (this._sharedMaterial != null) { this._x = Mathf.Repeat(this._x + 60f * Time.deltaTime * this.addSpeedX, 1f); this._y = Mathf.Repeat(this._y + 60f * Time.deltaTime * this.addSpeedY, 1f); Vector2 value = new Vector2(this._x, this._y); this._sharedMaterial.SetTextureOffset(this.TextureName, value); } } // Token: 0x040055DA RID: 21978 [SerializeField] private string TextureName = "_MainTex"; // Token: 0x040055DB RID: 21979 [SerializeField] private float addSpeedX; // Token: 0x040055DC RID: 21980 [SerializeField] private float addSpeedY; // Token: 0x040055DD RID: 21981 [SerializeField] private Renderer[] _renderers; // Token: 0x040055DE RID: 21982 private Material _sharedMaterial; // Token: 0x040055DF RID: 21983 private float _x; // Token: 0x040055E0 RID: 21984 private float _y; } }