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.
HighGroundRoyaleNetcode/Assets/Scripts/ScrollingLineRenderer.cs

32 lines
909 B
C#

2 days ago
using Unity.BossRoom.Gameplay.GameplayObjects.Character;
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
2 days ago
public ServerCharacter serverCharacter;
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);
}
2 days ago
private void SendDecisionToServer()
{
if (serverCharacter != null)
{
serverCharacter.NotifySwapDecisionRpc(true);
}
}
}