修改公司信息点显示
This commit is contained in:
parent
931b20c3be
commit
b2d41b1f27
Binary file not shown.
|
|
@ -0,0 +1,238 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &4340051599740625553
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 6583079527514720688}
|
||||
m_Layer: 5
|
||||
m_Name: InfoItemNew
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &6583079527514720688
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4340051599740625553}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 4138532610267430703}
|
||||
- {fileID: 7089511768739321511}
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 228.49, y: 50}
|
||||
m_Pivot: {x: 0, y: 0.5}
|
||||
--- !u!1 &8527357432759731542
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 4138532610267430703}
|
||||
- component: {fileID: 2473616362893654288}
|
||||
- component: {fileID: 3268273220795620078}
|
||||
m_Layer: 5
|
||||
m_Name: Image
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &4138532610267430703
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8527357432759731542}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 6583079527514720688}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0.5}
|
||||
m_AnchorMax: {x: 0, y: 0.5}
|
||||
m_AnchoredPosition: {x: -0.0000076293945, y: -0.0000038146973}
|
||||
m_SizeDelta: {x: 16, y: 16}
|
||||
m_Pivot: {x: 0, y: 0.5}
|
||||
--- !u!222 &2473616362893654288
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8527357432759731542}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &3268273220795620078
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8527357432759731542}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 21300000, guid: 9ddbc824e7043ef438a1cb4110235928, type: 3}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!1001 &5530449940732050866
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
serializedVersion: 3
|
||||
m_TransformParent: {fileID: 6583079527514720688}
|
||||
m_Modifications:
|
||||
- target: {fileID: 1642930879195753946, guid: beebee9dfeefa33439307554aabd320f,
|
||||
type: 3}
|
||||
propertyPath: m_Name
|
||||
value: InfoItem
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3360560048676891413, guid: beebee9dfeefa33439307554aabd320f,
|
||||
type: 3}
|
||||
propertyPath: m_Pivot.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3360560048676891413, guid: beebee9dfeefa33439307554aabd320f,
|
||||
type: 3}
|
||||
propertyPath: m_Pivot.y
|
||||
value: 0.5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3360560048676891413, guid: beebee9dfeefa33439307554aabd320f,
|
||||
type: 3}
|
||||
propertyPath: m_AnchorMax.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3360560048676891413, guid: beebee9dfeefa33439307554aabd320f,
|
||||
type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0.5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3360560048676891413, guid: beebee9dfeefa33439307554aabd320f,
|
||||
type: 3}
|
||||
propertyPath: m_AnchorMin.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3360560048676891413, guid: beebee9dfeefa33439307554aabd320f,
|
||||
type: 3}
|
||||
propertyPath: m_AnchorMin.y
|
||||
value: 0.5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3360560048676891413, guid: beebee9dfeefa33439307554aabd320f,
|
||||
type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 207.5437
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3360560048676891413, guid: beebee9dfeefa33439307554aabd320f,
|
||||
type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 50
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3360560048676891413, guid: beebee9dfeefa33439307554aabd320f,
|
||||
type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3360560048676891413, guid: beebee9dfeefa33439307554aabd320f,
|
||||
type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3360560048676891413, guid: beebee9dfeefa33439307554aabd320f,
|
||||
type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3360560048676891413, guid: beebee9dfeefa33439307554aabd320f,
|
||||
type: 3}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3360560048676891413, guid: beebee9dfeefa33439307554aabd320f,
|
||||
type: 3}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: -0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3360560048676891413, guid: beebee9dfeefa33439307554aabd320f,
|
||||
type: 3}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: -0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3360560048676891413, guid: beebee9dfeefa33439307554aabd320f,
|
||||
type: 3}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: -0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3360560048676891413, guid: beebee9dfeefa33439307554aabd320f,
|
||||
type: 3}
|
||||
propertyPath: m_AnchoredPosition.x
|
||||
value: 20.947481
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3360560048676891413, guid: beebee9dfeefa33439307554aabd320f,
|
||||
type: 3}
|
||||
propertyPath: m_AnchoredPosition.y
|
||||
value: -0.00025177002
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3360560048676891413, guid: beebee9dfeefa33439307554aabd320f,
|
||||
type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3360560048676891413, guid: beebee9dfeefa33439307554aabd320f,
|
||||
type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3360560048676891413, guid: beebee9dfeefa33439307554aabd320f,
|
||||
type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_RemovedGameObjects: []
|
||||
m_AddedGameObjects: []
|
||||
m_AddedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: beebee9dfeefa33439307554aabd320f, type: 3}
|
||||
--- !u!224 &7089511768739321511 stripped
|
||||
RectTransform:
|
||||
m_CorrespondingSourceObject: {fileID: 3360560048676891413, guid: beebee9dfeefa33439307554aabd320f,
|
||||
type: 3}
|
||||
m_PrefabInstance: {fileID: 5530449940732050866}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: c9842aaec840f7541b12b1bb35adc183
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -11,9 +11,11 @@ GameObject:
|
|||
- component: {fileID: 277059286312408957}
|
||||
- component: {fileID: 4713481451619143330}
|
||||
- component: {fileID: 8809245255521828328}
|
||||
- component: {fileID: 3647557558421153167}
|
||||
- component: {fileID: 8012138282450112361}
|
||||
m_Layer: 0
|
||||
m_Name: "\u516C\u53F8\u4FE1\u606F\u70B9"
|
||||
m_TagString: Untagged
|
||||
m_TagString: companyInfo
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
|
|
@ -26,7 +28,7 @@ Transform:
|
|||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1185835042058589474}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0.7071068, y: -0, z: -0, w: 0.7071068}
|
||||
m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068}
|
||||
m_LocalPosition: {x: 12.9, y: 4.3, z: 25.8}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 1
|
||||
|
|
@ -83,3 +85,36 @@ MeshRenderer:
|
|||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
m_AdditionalVertexStreams: {fileID: 0}
|
||||
--- !u!65 &3647557558421153167
|
||||
BoxCollider:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1185835042058589474}
|
||||
m_Material: {fileID: 0}
|
||||
m_IncludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_ExcludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_LayerOverridePriority: 0
|
||||
m_IsTrigger: 0
|
||||
m_ProvidesContacts: 0
|
||||
m_Enabled: 1
|
||||
serializedVersion: 3
|
||||
m_Size: {x: 1.5, y: 1.5, z: 1}
|
||||
m_Center: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &8012138282450112361
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1185835042058589474}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: dfaaf66389893e44eba168149f378081, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -82,6 +82,7 @@ public class Bootstrap : MonoSingleton<Bootstrap>
|
|||
[HideInInspector]
|
||||
public DataController dataController;
|
||||
public GameObject lastLand;
|
||||
public GameObject lastCompanyPoint;
|
||||
[Header("依附哪个层级上的物体")]
|
||||
public List<DependencyLevel> dependencyLevel = new List<DependencyLevel>();
|
||||
public int clickCurrentLevel = 2;
|
||||
|
|
@ -137,12 +138,30 @@ public class Bootstrap : MonoSingleton<Bootstrap>
|
|||
if (hit.collider != null)
|
||||
{
|
||||
landMarks.Clear();
|
||||
if (hit.collider.gameObject != lastLand)
|
||||
if (!hit.collider.CompareTag("companyInfo"))
|
||||
{
|
||||
CloseLandMark();
|
||||
if (hit.collider.gameObject != lastLand)
|
||||
{
|
||||
CloseLandMark();
|
||||
}
|
||||
currentLand = hit.collider.gameObject;
|
||||
if (currentLand == lastLand) return;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (hit.collider.gameObject != lastCompanyPoint)
|
||||
{
|
||||
|
||||
Debug.Log("¹«Ë¾");
|
||||
landMarks = hit.collider.GetComponent<CompanyInfo>().GetCompanyInfo();
|
||||
Vector3 worldToScreenPoint = Camera.main.WorldToScreenPoint(new Vector3(hit.collider.gameObject.transform.position.x, hit.collider.gameObject.transform.position.y, hit.collider.gameObject.transform.position.z));
|
||||
landMarkAndInfoCotroller.gameObject.SetActive(true);
|
||||
landMarkAndInfoCotroller.GetComponent<RectTransform>().position = new Vector3(worldToScreenPoint.x, worldToScreenPoint.y, 0);
|
||||
if (currentArea != null)
|
||||
landMarkAndInfoCotroller.SetMarksInfo(currentArea.name, landMarks);
|
||||
lastCompanyPoint = hit.collider.gameObject;
|
||||
}
|
||||
}
|
||||
currentLand = hit.collider.gameObject;
|
||||
if (currentLand == lastLand) return;
|
||||
ShowLandMark();
|
||||
}
|
||||
else
|
||||
|
|
@ -218,6 +237,7 @@ public class Bootstrap : MonoSingleton<Bootstrap>
|
|||
lastLand = null;
|
||||
}
|
||||
currentLand = null;
|
||||
lastCompanyPoint = null;
|
||||
//SwitchLevel(currentLevel);
|
||||
}
|
||||
|
||||
|
|
@ -302,6 +322,10 @@ public class Bootstrap : MonoSingleton<Bootstrap>
|
|||
if (!string.IsNullOrEmpty(disCodeTemp))
|
||||
{
|
||||
currentDistCode = int.Parse(disCodeTemp);
|
||||
if (currentArea.GetComponent<CityInfo>().LA.x != 0)
|
||||
{
|
||||
currentArea.GetComponent<CityInfo>().SetOriginalVectorAndL();
|
||||
}
|
||||
dataController.GetAllCompanyInfo(disCodeTemp);
|
||||
}
|
||||
//Debug.Log("区县");
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ public class AggregateStation : MonoBehaviour
|
|||
//float x = size.x - marginHorizontal;
|
||||
//float y = size.y - marginVertical;
|
||||
//instructTextBackground.size = new Vector2(x, y);
|
||||
|
||||
OnEnable();
|
||||
|
||||
}
|
||||
private void OnEnable()
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@ using System.Collections;
|
|||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
|
||||
public class CityInfo : MonoBehaviour
|
||||
{
|
||||
public string distCode;
|
||||
|
|
@ -10,15 +12,49 @@ public class CityInfo : MonoBehaviour
|
|||
public AreaData areaData = new AreaData();
|
||||
public int Level = 0;
|
||||
public GameObject tips;
|
||||
|
||||
public Vector2D LA;
|
||||
public Vector2D LB;
|
||||
public Vector2D LC;
|
||||
|
||||
public Vector2D VA;
|
||||
public Vector2D VB;
|
||||
public Vector2D VC;
|
||||
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
if (!GetComponent<Collider>())
|
||||
gameObject.AddComponent<MeshCollider>();
|
||||
if (transform.childCount > 0)
|
||||
if (Level != 3)
|
||||
{
|
||||
tips = transform.GetChild(0).gameObject;
|
||||
tips.AddComponent<DistanceAdjuster>();
|
||||
tips.SetActive(false);
|
||||
if (!GetComponent<Collider>())
|
||||
gameObject.AddComponent<MeshCollider>();
|
||||
if (transform.childCount > 0)
|
||||
{
|
||||
tips = transform.GetChild(0).gameObject;
|
||||
tips.AddComponent<DistanceAdjuster>();
|
||||
tips.SetActive(false);
|
||||
}
|
||||
}
|
||||
if (transform.childCount > 0 && transform.GetChild(0).childCount > 0)
|
||||
{
|
||||
Transform a = transform.GetChild(0).transform.Find("1");
|
||||
if (a != null)
|
||||
{
|
||||
VA.x = a.position.x;
|
||||
VA.y = a.position.z;
|
||||
}
|
||||
Transform b = transform.GetChild(0).transform.Find("2");
|
||||
if (b != null)
|
||||
{
|
||||
VB.x = b.position.x;
|
||||
VB.y = b.position.z;
|
||||
}
|
||||
Transform c = transform.GetChild(0).transform.Find("3");
|
||||
if (c != null)
|
||||
{
|
||||
VC.x = c.position.x;
|
||||
VC.y = c.position.z;
|
||||
}
|
||||
}
|
||||
}
|
||||
public void Init()
|
||||
|
|
@ -28,6 +64,11 @@ public class CityInfo : MonoBehaviour
|
|||
|
||||
}
|
||||
|
||||
public void SetOriginalVectorAndL()
|
||||
{
|
||||
WebApiExtension.SetVector2D(LA, LB, LC, VA, VB, VC);
|
||||
}
|
||||
|
||||
public void OnSetStationInfo()
|
||||
{
|
||||
if (!string.IsNullOrEmpty(distCode) && distCode.Length == 4 && Level != 3)
|
||||
|
|
@ -57,6 +98,7 @@ public class CityInfo : MonoBehaviour
|
|||
|
||||
public void SetScreenTopStatistices(int stationIndex)
|
||||
{
|
||||
if (Level == 3) return;
|
||||
if (transform.childCount == 0) return;
|
||||
if (sts != null && !string.IsNullOrEmpty(sts.distCode))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -0,0 +1,14 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class CompanyInfo : MonoBehaviour
|
||||
{
|
||||
public AreaCompany companyInfo;
|
||||
|
||||
public List<string> GetCompanyInfo()
|
||||
{
|
||||
List<string> infos = new List<string> {companyInfo.consName };
|
||||
return infos;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: dfaaf66389893e44eba168149f378081
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -6,21 +6,24 @@ using UnityEngine;
|
|||
public class LandMarksAndInfoController : MonoBehaviour
|
||||
{
|
||||
public TMP_Text tmpText;
|
||||
public TMP_Text infoItemPrefab;
|
||||
public Transform infoItemPrefab;
|
||||
public TMP_Text infoItemText;
|
||||
public RectTransform infoTextContent;
|
||||
|
||||
|
||||
public void SetMarksInfo(string lnadName, List<string> landLoadInfos)
|
||||
public void SetMarksInfo(string lnadName, List<string> landLoadInfos, bool isShowCityName = true)
|
||||
{
|
||||
tmpText.text = lnadName;
|
||||
for (int i = 0; i < infoTextContent.childCount; i++)
|
||||
for (int i = 1; i < infoTextContent.childCount; i++)
|
||||
{
|
||||
Destroy(infoTextContent.GetChild(i).gameObject);
|
||||
}
|
||||
infoTextContent.GetChild(0).gameObject.SetActive(isShowCityName);
|
||||
for (int i = 0; i < landLoadInfos.Count; i++)
|
||||
{
|
||||
TMP_Text rt = Instantiate(infoItemPrefab, infoTextContent);
|
||||
rt.text = landLoadInfos[i];
|
||||
Transform rt = Instantiate(infoItemPrefab, infoTextContent);
|
||||
infoItemText = rt.GetComponentInChildren<TMP_Text>();
|
||||
infoItemText.text = landLoadInfos[i];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ public class LevelBtnAttach : MonoBehaviour
|
|||
public TMP_Text selfText;
|
||||
public string currrentCityName;
|
||||
public int index = 0;
|
||||
void Start()
|
||||
private void Awake()
|
||||
{
|
||||
selfImage = GetComponent<Image>();
|
||||
selfBtns = GetComponent<Button>();
|
||||
|
|
|
|||
|
|
@ -66,6 +66,7 @@ public struct Coordinate
|
|||
//高度
|
||||
public double alt;
|
||||
}
|
||||
[Serializable]
|
||||
public struct Vector2D
|
||||
{
|
||||
public double x;
|
||||
|
|
@ -187,6 +188,18 @@ public static class WebApiExtension
|
|||
private static Vector2D _VB = new Vector2D(4.03, 37.31);
|
||||
private static Vector2D _VC = new Vector2D(56.41, -3.06);
|
||||
|
||||
|
||||
public static void SetVector2D(Vector2D _LAT, Vector2D _LBT,Vector2D _LCT, Vector2D _VAT, Vector2D _VBT, Vector2D _VCT)
|
||||
{
|
||||
_LA = _LAT;
|
||||
_LB = _LBT;
|
||||
_LC = _LCT;
|
||||
_VA = _VAT;
|
||||
_VB = _VBT;
|
||||
_VC = _VCT;
|
||||
}
|
||||
|
||||
|
||||
//由经纬度转米。根据三点转化
|
||||
private static Vector2D L2V(Vector2D p)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -39,10 +39,10 @@ public class DataController : MonoSingleton<DataController>
|
|||
public AreaCompanyInformationData companyInformationData = new AreaCompanyInformationData();
|
||||
private Dictionary<string, string> urlDic = new Dictionary<string, string>();
|
||||
|
||||
public GameObject companyPointPrefab;
|
||||
public CompanyInfo companyPointPrefab;
|
||||
public GameObject btns;
|
||||
|
||||
public List<GameObject> companyPoint = new List<GameObject>();
|
||||
public List<CompanyInfo> companyPoint = new List<CompanyInfo>();
|
||||
public int currentStationID = 0;
|
||||
|
||||
private void Awake()
|
||||
|
|
@ -82,36 +82,6 @@ public class DataController : MonoSingleton<DataController>
|
|||
OnInit();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public double originLatitude = 37.7749;
|
||||
public double originLongitude = -122.4194;
|
||||
public double originAltitude = 0.0;
|
||||
|
||||
// 转换后的Unity位置
|
||||
public Vector3 GPSToUnityWorld(double latitude, double longitude, double altitude)
|
||||
{
|
||||
// 地球半径(单位:米)
|
||||
double radius = 6378137;
|
||||
|
||||
// 计算相对位置
|
||||
double deltaLat = latitude - originLatitude;
|
||||
double deltaLon = longitude - originLongitude;
|
||||
|
||||
// 经度差转换为米
|
||||
double deltaX = deltaLon * Mathf.Deg2Rad * radius * Mathf.Cos((float)(originLatitude * Mathf.Deg2Rad));
|
||||
|
||||
// 纬度差转换为米
|
||||
double deltaZ = deltaLat * Mathf.Deg2Rad * radius;
|
||||
|
||||
// 高度差
|
||||
double deltaY = altitude - originAltitude;
|
||||
|
||||
// 返回转换后的Unity位置
|
||||
return new Vector3((float)deltaX, (float)deltaY, (float)deltaZ);
|
||||
}
|
||||
|
||||
private async void OnInit()
|
||||
{
|
||||
await UniTask.Delay(1);
|
||||
|
|
@ -122,12 +92,6 @@ public class DataController : MonoSingleton<DataController>
|
|||
{
|
||||
cityInfos[i].Init();
|
||||
}
|
||||
//areaPopUpDatasTasksReturnValue = await UniTask.WhenAll(loadingAreaDataTasks);
|
||||
//for (int i = 0; i < cityInfos.Length; i++)
|
||||
//{
|
||||
// string distCodeTemp = cityInfos[i].distCode;
|
||||
// cityInfos[i].SetAreaData(GetAreaDateByDistCode(distCodeTemp));
|
||||
//}
|
||||
areaStationDatasTasksReturnValue = await UniTask.WhenAll(loadingScreenTopStatisticsTasks);
|
||||
|
||||
for (int i = 0; i < areaStationDatasTasksReturnValue.Length; i++)
|
||||
|
|
@ -151,8 +115,6 @@ public class DataController : MonoSingleton<DataController>
|
|||
}
|
||||
public async void GetAllCompanyInfo(string _distCode)
|
||||
{
|
||||
|
||||
|
||||
companyInformationData = await GetAreaCompanyInformationData(_distCode);
|
||||
for (int i = 0; i < companyInformationData.data.Count; i++)
|
||||
{
|
||||
|
|
@ -160,7 +122,8 @@ public class DataController : MonoSingleton<DataController>
|
|||
coords.lat = companyInformationData.data[i].latitude;
|
||||
coords.lon = companyInformationData.data[i].longitude;
|
||||
coords.alt = 1986;
|
||||
GameObject obj = Instantiate(companyPointPrefab);
|
||||
CompanyInfo obj = Instantiate(companyPointPrefab);
|
||||
obj.companyInfo = companyInformationData.data[i];
|
||||
obj.transform.position = coords.AsVector3();
|
||||
companyPoint.Add(obj);
|
||||
//Vector3 temp = WebApiExtension.GPSToVector3(companyInformationData.data[i].latitude, companyInformationData.data[i].longitude);
|
||||
|
|
@ -174,7 +137,7 @@ public class DataController : MonoSingleton<DataController>
|
|||
{
|
||||
for (int i = 0; i < companyPoint.Count; i++)
|
||||
{
|
||||
Destroy(companyPoint[i]);
|
||||
Destroy(companyPoint[i].gameObject);
|
||||
}
|
||||
companyPoint.Clear();
|
||||
}
|
||||
|
|
|
|||
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
|
|
@ -0,0 +1,127 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 9ddbc824e7043ef438a1cb4110235928
|
||||
TextureImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 12
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
flipGreenChannel: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
vTOnly: 0
|
||||
ignoreMipmapLimit: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: 1
|
||||
aniso: 1
|
||||
mipBias: 0
|
||||
wrapU: 1
|
||||
wrapV: 1
|
||||
wrapW: 0
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 1
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 1
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 8
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
flipbookRows: 1
|
||||
flipbookColumns: 1
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
ignorePngGamma: 0
|
||||
applyGammaDecoding: 0
|
||||
swizzle: 50462976
|
||||
cookieLightType: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Standalone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: WebGL
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID: 5e97eb03825dee720800000000000000
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
nameFileIdTable: {}
|
||||
mipmapLimitGroupName:
|
||||
pSDRemoveMatte: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -3,7 +3,8 @@
|
|||
--- !u!78 &1
|
||||
TagManager:
|
||||
serializedVersion: 2
|
||||
tags: []
|
||||
tags:
|
||||
- companyInfo
|
||||
layers:
|
||||
- Default
|
||||
- TransparentFX
|
||||
|
|
@ -11,7 +12,7 @@ TagManager:
|
|||
-
|
||||
- Water
|
||||
- UI
|
||||
-
|
||||
- companyInfo
|
||||
-
|
||||
-
|
||||
-
|
||||
|
|
|
|||
Loading…
Reference in New Issue