备份CatanBuilding瘦身独立工程
This commit is contained in:
63
Assets/Scripts/TravelMap/TravelMapCampReveiwPanel.cs
Normal file
63
Assets/Scripts/TravelMap/TravelMapCampReveiwPanel.cs
Normal file
@@ -0,0 +1,63 @@
|
||||
using asap.core;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class TravelMapCampReveiwPanel : MonoBehaviour
|
||||
{
|
||||
Button btn_close;
|
||||
Button btn_left;
|
||||
Button btn_right;
|
||||
UIDrag uiDrag;
|
||||
|
||||
TMP_Text text_name;
|
||||
TravelMapCtrl travelMapCtrl;
|
||||
private void Awake()
|
||||
{
|
||||
travelMapCtrl = GContext.container.Resolve<TravelMapCtrl>();
|
||||
uiDrag = transform.Find("root/drag").GetComponent<UIDrag>();
|
||||
btn_close = transform.Find("root/btn_close").GetComponent<Button>();
|
||||
btn_left = transform.Find("root/btn_left").GetComponent<Button>();
|
||||
btn_right = transform.Find("root/btn_right").GetComponent<Button>();
|
||||
text_name = transform.Find("root/title/text_title").GetComponent<TMP_Text>();
|
||||
}
|
||||
private void Start()
|
||||
{
|
||||
btn_close.onClick.AddListener(OnClose);
|
||||
btn_left.onClick.AddListener(OnLeft);
|
||||
btn_right.onClick.AddListener(OnRight);
|
||||
uiDrag.OnBeginDragCall = () =>
|
||||
{
|
||||
|
||||
#if UNITY_EDITOR
|
||||
if (Input.GetMouseButton(0))
|
||||
#else
|
||||
if (Input.touchCount == 1)
|
||||
#endif
|
||||
{
|
||||
GContext.Publish(new SwitchVirtualCameraEvent() { type = 12, isDrag = true });
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private void OnLeft()
|
||||
{
|
||||
travelMapCtrl.OnLeft();
|
||||
}
|
||||
|
||||
private void OnRight()
|
||||
{
|
||||
travelMapCtrl.OnRight();
|
||||
|
||||
}
|
||||
|
||||
public void SetName(string name)
|
||||
{
|
||||
text_name.text = name;
|
||||
}
|
||||
private void OnClose()
|
||||
{
|
||||
|
||||
travelMapCtrl.OutVisit();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user