Files
back_cantanBuilding/Assets/Scripts/TravelMap/TravelMapCampPhotoPanel.cs
2026-05-26 16:15:54 +08:00

39 lines
980 B
C#

using asap.core;
using UnityEngine;
using UnityEngine.UI;
public class TravelMapCampPhotoPanel : MonoBehaviour
{
Button btn_photo;
UIDrag uiDrag;
TravelMapPhotoPanel travelMapPhotoPanel;
private void Awake()
{
btn_photo = transform.Find("root/btn_photo").GetComponent<Button>();
uiDrag = transform.Find("root/drag").GetComponent<UIDrag>();
travelMapPhotoPanel = transform.Find("TravelMapPhotoPanel").GetComponent<TravelMapPhotoPanel>();
}
private void Start()
{
btn_photo.onClick.AddListener(OnCaptureFishPhoto);
uiDrag.OnBeginDragCall = () =>
{
#if UNITY_EDITOR
if (Input.GetMouseButton(0))
#else
if (Input.touchCount == 1)
#endif
{
GContext.Publish(new SwitchVirtualCameraEvent() { type = 12, isDrag = true });
}
};
}
void OnCaptureFishPhoto()
{
travelMapPhotoPanel.gameObject.SetActive(true);
}
}