dinorun/Assets/Scripts/Ground.cs
2025-07-29 15:15:49 +05:30

22 lines
492 B
C#

using System;
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
public class Ground : MonoBehaviour
{
private MeshRenderer meshRenderer;
private void Awake()
{
meshRenderer = GetComponent<MeshRenderer>();
}
private void Update()
{
float speed = GameManager.Instance.gameSpeed / transform.localScale.x;
meshRenderer.material.mainTextureOffset += Vector2.right * speed * Time.deltaTime;
}
}