mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/MI-38.git
synced 2026-01-23 23:55:38 +03:00
53 lines
1.9 KiB
C#
53 lines
1.9 KiB
C#
using UnityEngine;
|
|
using UnityEngine.EventSystems;
|
|
using UnityEngine.UI;
|
|
|
|
public class searchPanel : MonoBehaviour, IPointerEnterHandler, IPointerDownHandler, IPointerExitHandler, IPointerUpHandler
|
|
{
|
|
[HideInInspector] public Manager manager;
|
|
[HideInInspector] public static bool IsSearch = false;
|
|
private Image[] img;
|
|
void Start()
|
|
{
|
|
manager = GameObject.Find("Manager").GetComponent<Manager>();
|
|
img = this.GetComponentsInChildren<Image>();
|
|
img[0].gameObject.SetActive(true);
|
|
img[1].gameObject.SetActive(false);
|
|
gameObject.GetComponentInChildren<Image>().color = (IsSearch) ? Color.green : Color.white;
|
|
|
|
}
|
|
|
|
public void OnPointerUp(PointerEventData eventData)
|
|
{
|
|
IsSearch = !IsSearch;
|
|
gameObject.GetComponentInChildren<Image>().color = (IsSearch) ? Color.green : Color.white;
|
|
//çäåñü íóæåí ìåòîä
|
|
}
|
|
|
|
public void OnPointerEnter(PointerEventData eventData)
|
|
{
|
|
img[0].gameObject.SetActive(false);
|
|
img[1].gameObject.SetActive(true);
|
|
gameObject.GetComponentInChildren<Image>().color = (IsSearch) ? Color.green : Color.white;
|
|
/* if (manager.viewmode == 1) manager.ChangeLayerIgnore();
|
|
else if (manager.viewmode == 2) manager.ChangeLayerPassCabineIgnore();*/
|
|
manager.mouseEnterUI();
|
|
}
|
|
|
|
public void OnPointerDown(PointerEventData eventData)
|
|
{
|
|
gameObject.GetComponentInChildren<Image>().color = Color.green;
|
|
|
|
}
|
|
|
|
public void OnPointerExit(PointerEventData eventData)
|
|
{
|
|
img[0].gameObject.SetActive(true);
|
|
img[1].gameObject.SetActive(false);
|
|
gameObject.GetComponentInChildren<Image>().color = (IsSearch) ? Color.green : Color.white;
|
|
/* if (manager.viewmode == 1) manager.ChangeLayerDefault();
|
|
else if (manager.viewmode == 2) manager.ChangeLayerPassCabineIgnore();*/
|
|
manager.mouseExitUI();
|
|
}
|
|
}
|