Initial Commit (broken due to version update)

This commit is contained in:
Reinier Vens 2020-09-25 07:12:38 +01:00
commit 3f7b3b7440
3132 changed files with 1103305 additions and 0 deletions

View file

@ -0,0 +1,28 @@
using System.Collections;
using System.Collections.Generic;
using System.Xml;
#if UNITY_EDITOR
using UnityEditor;
#endif
using UnityEngine;
[ExecuteInEditMode]
public class TextureScroll : MonoBehaviour
{
public Vector2 TextureScrollSpeed;
private MeshRenderer _targetMesh;
private void OnWillRenderObject()
{
if(_targetMesh==null) _targetMesh = GetComponent<MeshRenderer>();
#if UNITY_EDITOR
float time = (float) EditorApplication.timeSinceStartup;
#else
float time = Time.time;
#endif
// Application.isPlaying ? Time.time : (float) EditorApplication.timeSinceStartup;
_targetMesh.sharedMaterial.mainTextureOffset = new Vector2(Mathf.Repeat(TextureScrollSpeed.x * time, 1), Mathf.Repeat(TextureScrollSpeed.y * time, 1));
}
}