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.
24 lines
642 B
C#
24 lines
642 B
C#
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
|
|
|
|
private void Start()
|
|
{
|
|
lineRenderer.material = scrollingMaterial;
|
|
}
|
|
void Update()
|
|
{
|
|
if (scrollingMaterial == null) return;
|
|
|
|
// Scroll texture over time
|
|
float offset = Time.time * speed;
|
|
scrollingMaterial.SetFloat("_Speed", speed);
|
|
scrollingMaterial.SetFloat("_Tiling", -tiling);
|
|
}
|
|
}
|