You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
1.2 KiB
43 lines
1.2 KiB
using Photon.Pun;
|
|
using UnityEngine;
|
|
using UnityEngine.EventSystems;
|
|
using UnityEngine.UI;
|
|
|
|
public class SelectionUICircuit : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler, IBeginDragHandler, IDragHandler, IEndDragHandler, IPointerClickHandler {
|
|
|
|
public CircuitType type;
|
|
public Image image;
|
|
public Text costText;
|
|
|
|
public void OnPointerEnter(PointerEventData data) {
|
|
image.color = Color.HSVToRGB(0, 0, 0.8f);
|
|
SelectionGUI.Instance.OnUICircuitPointerEnter(this);
|
|
}
|
|
public void OnPointerExit(PointerEventData data) {
|
|
image.color = Color.white;
|
|
SelectionGUI.Instance.OnUICircuitPointerExit(this);
|
|
}
|
|
public void OnBeginDrag(PointerEventData data) {
|
|
SelectionGUI.Instance.OnUICircuitBeginDrag(this);
|
|
}
|
|
public void OnDrag(PointerEventData eventData) {
|
|
SelectionGUI.Instance.OnUICircuitDrag(this);
|
|
}
|
|
public void OnEndDrag(PointerEventData data) {
|
|
SelectionGUI.Instance.OnUICircuitEndDrag(this);
|
|
}
|
|
public void OnPointerClick(PointerEventData eventData) {
|
|
SelectionGUI.Instance.OnUICircuitPointerClick(this);
|
|
}
|
|
|
|
|
|
void Start() {
|
|
image.material = ColorManager.GetUiBy(PhotonNetwork.LocalPlayer.ActorNumber);
|
|
}
|
|
|
|
public void SetCost(int cost) {
|
|
costText.text = cost.ToString();
|
|
}
|
|
|
|
|
|
}
|
|
|