ZoneController.cs 669 B

1234567891011121314151617181920212223242526272829303132333435
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5. public class ZoneController : MonoBehaviour
  6. {
  7. public bool ZoneColor = true;
  8. public TextMesh TextMesh;
  9. // Start is called before the first frame update
  10. void Start()
  11. {
  12. }
  13. // Update is called once per frame
  14. void Update()
  15. {
  16. }
  17. void OnMouseOver()
  18. {
  19. if(ZoneColor) transform.GetComponent<Renderer>().material.color = new Color(0, 1, 0, 0.5f);
  20. }
  21. void OnMouseExit()
  22. {
  23. if (ZoneColor) transform.GetComponent<Renderer>().material.color = new Color(1, 0, 0, 0.5f);
  24. }
  25. }