12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.UI;
- public class ZoneController : MonoBehaviour
- {
- public uint id;
- public string name_zone;
- public bool ZoneColor = true;
- public TextMesh TextMesh;
- // Start is called before the first frame update
- void Start()
- {
- }
- // Update is called once per frame
- void Update()
- {
- }
- void OnMouseOver()
- {
- if (ZoneColor) transform.GetComponent<Renderer>().material.color = new Color(0, 1, 0, 0.5f);
- }
- void OnMouseExit()
- {
- if (ZoneColor) transform.GetComponent<Renderer>().material.color = new Color(1, 0, 0, 0.5f);
- }
- public void Rename(string name_obj, string name)
- {
- gameObject.name = name_obj;
- TextMesh.text = name;
- }
- }
|