Newer
Older
Traffic-Simulator / Assets / Scripts / Config.cs
@Lukas Lukas on 30 Jan 2022 617 bytes add diferent editing modes
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Config : MonoBehaviour {
    public Material roadMaterial, roadEditMaterial;
    public Mode mode = Mode.DeleteRoad;
    public Mode futureMode;
    public RectTransform highlight;

    public void click(Mode mode, int index) {
        this.mode = Mode.ClickButton;
        futureMode = mode;
        highlight.anchoredPosition = new Vector3(36f * (1.5f*index+1), 36f, 0f);
    }

    void Update() {
        if (Input.GetAxis("Fire1") == 0.0f && mode == Mode.ClickButton) {
            mode = futureMode;
        }
    }
}