You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
554 B
C#
20 lines
554 B
C#
1 week ago
|
using UnityEngine;
|
||
|
|
||
|
public class ScrollingLineRenderer : MonoBehaviour
|
||
|
{
|
||
|
public LineRenderer lineRenderer;
|
||
|
public Material scrollingMaterial;
|
||
|
public float speed = 1.0f; // Adjust speed in Inspector
|
||
|
public float tiling = 1.0f; // Controls how many arrows fit in the line
|
||
|
|
||
|
void Update()
|
||
|
{
|
||
|
if (scrollingMaterial == null) return;
|
||
|
|
||
|
// Scroll texture over time
|
||
1 week ago
|
float offset = Time.time * speed;
|
||
1 week ago
|
scrollingMaterial.SetFloat("_Speed", speed);
|
||
1 week ago
|
scrollingMaterial.SetFloat("_Tiling", -tiling);
|
||
1 week ago
|
}
|
||
|
}
|