32 lines
780 B
C#
32 lines
780 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.EventSystems;
|
|
using UnityEngine.UI;
|
|
|
|
public class HoveredUI : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler
|
|
{
|
|
private GhostManagerV2 ghostManager;
|
|
|
|
private void Start()
|
|
{
|
|
ghostManager = GhostManagerV2.getInstance();
|
|
}
|
|
|
|
public void OnPointerEnter(PointerEventData eventData)
|
|
{
|
|
ghostManager.clearGhost();
|
|
ghostManager.setDrag(false);
|
|
if (!InputModeManager.Is(InputMode.UI))
|
|
InputModeManager.Push(InputMode.UI);
|
|
}
|
|
|
|
public void OnPointerExit(PointerEventData eventData)
|
|
{
|
|
ghostManager.setupBlock();
|
|
ghostManager.setDrag(true);
|
|
InputModeManager.Pop(InputMode.UI);
|
|
}
|
|
|
|
}
|