Initial import of Rhyculator
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
commit
728bb0c657
315 files changed
+96030
No files matched your search
@@ -0,0 +1,35 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class MarqueeText : MonoBehaviour
|
||||
{
|
||||
public float speed = 50f;
|
||||
public float resetOffset = 500f;
|
||||
public float waitTime = 1.0f;
|
||||
|
||||
private RectTransform rect;
|
||||
private float waitTimer = 0f;
|
||||
|
||||
void Start()
|
||||
{
|
||||
rect = GetComponent<RectTransform>();
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
|
||||
if (waitTimer > 0f)
|
||||
{
|
||||
waitTimer -= Time.deltaTime;
|
||||
return;
|
||||
}
|
||||
|
||||
rect.anchoredPosition += Vector2.left * speed * Time.deltaTime;
|
||||
|
||||
if (rect.anchoredPosition.x <= -resetOffset)
|
||||
{
|
||||
rect.anchoredPosition = new Vector2(resetOffset, rect.anchoredPosition.y);
|
||||
waitTimer = waitTime;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user