Unity 3D Road Manager Script! How we manage a road image on scene

in #unity5 years ago

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Road : MonoBehaviour {
public GameObject plance;
public Renderer planeRenderer;
public float speed = 1f;
private Vector2 offset;
// Use this for initialization
void Start () {
planeRenderer = plance.GetComponent<Renderer ();
}

// Update is called once per frame
void Update () {
    offset.y += -speed * Time.deltaTime;
    planeRenderer.material.SetTextureOffset ("_MainTex", offset);
}

}Road Non Sprite.jpgRoad Non Sprite.jpg

Coin Marketplace

STEEM 0.19
TRX 0.14
JST 0.030
BTC 60078.84
ETH 3197.52
USDT 1.00
SBD 2.45