22 lines
492 B
C#
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;
|
|
}
|
|
}
|