This commit is contained in:
parent
2b21c2f469
commit
617cc9d161
|
|
@ -14,8 +14,8 @@ public class WorkPlacePanel : MonoBehaviour
|
||||||
public void Init(string custCodes, WorkPlaceItem workPlaceItem)
|
public void Init(string custCodes, WorkPlaceItem workPlaceItem)
|
||||||
{
|
{
|
||||||
this.workPlaceItem = workPlaceItem;
|
this.workPlaceItem = workPlaceItem;
|
||||||
InitModel(custCodes);
|
|
||||||
rectTransform = GetComponent<RectTransform>();
|
rectTransform = GetComponent<RectTransform>();
|
||||||
|
InitModel(custCodes);
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 生成企业图标
|
/// 生成企业图标
|
||||||
|
|
@ -31,10 +31,11 @@ public class WorkPlacePanel : MonoBehaviour
|
||||||
|
|
||||||
//获取关区下所有企业信息
|
//获取关区下所有企业信息
|
||||||
//string url = "http://" + FirstPanel.instance.serverIP + ":4000/api/Corporation/GetAllPosition?customCodes=" + custCodes;
|
//string url = "http://" + FirstPanel.instance.serverIP + ":4000/api/Corporation/GetAllPosition?customCodes=" + custCodes;
|
||||||
string url = "http://" + FirstPanel.instance.serverIP + ":4000/api/GetModelList?PageIndex=1&PageSize=999999";
|
string url = "http://" + FirstPanel.instance.serverIP + ":4000/api/GetModelVersionList";
|
||||||
Debug.Log("获取企业模型:" + url);
|
Debug.Log("获取企业模型:" + url);
|
||||||
StartCoroutine(FirstPanel.instance.CallGet(url, (isok, result) =>
|
StartCoroutine(FirstPanel.instance.CallGet(url, (isok, result) =>
|
||||||
{
|
{
|
||||||
|
Debug.Log("获取企业模型返回 "+ result);
|
||||||
if (isok)
|
if (isok)
|
||||||
{
|
{
|
||||||
//生成企业模型
|
//生成企业模型
|
||||||
|
|
@ -45,8 +46,11 @@ public class WorkPlacePanel : MonoBehaviour
|
||||||
foreach (JsonData item in tmp)
|
foreach (JsonData item in tmp)
|
||||||
{
|
{
|
||||||
erprise_model_version v = JsonMapper.ToObject<erprise_model_version>(item.ToJson());
|
erprise_model_version v = JsonMapper.ToObject<erprise_model_version>(item.ToJson());
|
||||||
|
if (!string.IsNullOrEmpty(v.MapLatitude) && !string.IsNullOrEmpty(v.MapLongitude))
|
||||||
|
{
|
||||||
list.Add(v);
|
list.Add(v);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//本关区的
|
//本关区的
|
||||||
List<erprise_model_version> showAll=new List<erprise_model_version>();
|
List<erprise_model_version> showAll=new List<erprise_model_version>();
|
||||||
|
|
@ -75,6 +79,20 @@ public class WorkPlacePanel : MonoBehaviour
|
||||||
|
|
||||||
Application.ExternalCall("ClickCustom", JsonMapper.ToJson(showAll));
|
Application.ExternalCall("ClickCustom", JsonMapper.ToJson(showAll));
|
||||||
Debug.Log("调前端显示企业" + custCodes);
|
Debug.Log("调前端显示企业" + custCodes);
|
||||||
|
|
||||||
|
|
||||||
|
//福清默认放大
|
||||||
|
if (workPlaceItem.workPlaceName == "驻福清办事处")
|
||||||
|
{
|
||||||
|
SetPos(new Vector2(124.3824f, 583.4997f));
|
||||||
|
SetScale(3);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SetPos(Vector2.zero);
|
||||||
|
SetScale(1);
|
||||||
|
}
|
||||||
|
|
||||||
#if UNITY_EDITOR
|
#if UNITY_EDITOR
|
||||||
Debug.Log(JsonMapper.ToJson(showAll));
|
Debug.Log(JsonMapper.ToJson(showAll));
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -91,8 +109,20 @@ public class WorkPlacePanel : MonoBehaviour
|
||||||
PointerEventData evnetdata = (PointerEventData)baseEvent;
|
PointerEventData evnetdata = (PointerEventData)baseEvent;
|
||||||
if (evnetdata.button == PointerEventData.InputButton.Left)
|
if (evnetdata.button == PointerEventData.InputButton.Left)
|
||||||
{
|
{
|
||||||
rectTransform.anchoredPosition += evnetdata.delta;
|
SetPos(rectTransform.anchoredPosition + evnetdata.delta);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void OnScorll(BaseEventData baseEvent)
|
||||||
|
{
|
||||||
|
PointerEventData evnetdata = (PointerEventData)baseEvent;
|
||||||
|
float value = (rectTransform.localScale.x + evnetdata.scrollDelta.y* 0.1f);
|
||||||
|
value = Mathf.Clamp(value, 1f, 3f);
|
||||||
|
SetScale(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SetPos(Vector2 anchoredPosition)
|
||||||
|
{
|
||||||
|
rectTransform.anchoredPosition = anchoredPosition;
|
||||||
//更新坐标
|
//更新坐标
|
||||||
List<erprise_model_version> list = new List<erprise_model_version>();
|
List<erprise_model_version> list = new List<erprise_model_version>();
|
||||||
transform.GetComponentsInChildren<ModelItem>(true).ToList().ForEach(a =>
|
transform.GetComponentsInChildren<ModelItem>(true).ToList().ForEach(a =>
|
||||||
|
|
@ -102,13 +132,9 @@ public class WorkPlacePanel : MonoBehaviour
|
||||||
});
|
});
|
||||||
Application.ExternalCall("OnBanShiChuChange", JsonMapper.ToJson(list));
|
Application.ExternalCall("OnBanShiChuChange", JsonMapper.ToJson(list));
|
||||||
}
|
}
|
||||||
}
|
private void SetScale(float scale)
|
||||||
public void OnScorll(BaseEventData baseEvent)
|
|
||||||
{
|
{
|
||||||
PointerEventData evnetdata = (PointerEventData)baseEvent;
|
rectTransform.localScale = new Vector3(scale, scale, scale);
|
||||||
float value = (rectTransform.localScale.x + evnetdata.scrollDelta.y* 0.1f);
|
|
||||||
value = Mathf.Clamp(value, 1f, 3f);
|
|
||||||
rectTransform.localScale=new Vector3(value, value, value);
|
|
||||||
|
|
||||||
//更新坐标
|
//更新坐标
|
||||||
List<erprise_model_version> list = new List<erprise_model_version>();
|
List<erprise_model_version> list = new List<erprise_model_version>();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue