Init
This commit is contained in:
31
Assets/ThirdParty/Lana Studio/Casual RPG VFX/Scripts/UVscroll.cs
vendored
Normal file
31
Assets/ThirdParty/Lana Studio/Casual RPG VFX/Scripts/UVscroll.cs
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class UVscroll : MonoBehaviour
|
||||
{
|
||||
// Scroll main texture based on time
|
||||
public int materialId = 0;
|
||||
public float scrollSpeedX = 0.5f;
|
||||
public float scrollSpeedY = 0.5f;
|
||||
Renderer rend;
|
||||
|
||||
void Start()
|
||||
{
|
||||
rend = GetComponent<Renderer>();
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
//GetComponent<LineRenderer>().materials[0].
|
||||
|
||||
|
||||
float offsetX = Time.time * scrollSpeedX;
|
||||
float offsetY = Time.time * scrollSpeedY;
|
||||
|
||||
rend.materials[materialId].SetTextureOffset("_MainTex", new Vector2(offsetX, offsetY));
|
||||
|
||||
//rend.material.SetTextureOffset("_MainTex", new Vector2(offsetX, offsetY));
|
||||
}
|
||||
|
||||
}
|
||||
11
Assets/ThirdParty/Lana Studio/Casual RPG VFX/Scripts/UVscroll.cs.meta
vendored
Normal file
11
Assets/ThirdParty/Lana Studio/Casual RPG VFX/Scripts/UVscroll.cs.meta
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 993abc9b17d83a8488efa7d8aedd96d6
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user