using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class RtkPos : MonoBehaviour
{
///
/// 显示物体
///
public List list_Obj;
///
/// 根据实地GPS数据转化位置信息 ( 与 List_Obj 对应)
///
public List list_Pos;
///
/// 根据玩家传输进来的Gps 推算出 物体位置
///
///
public void SettingPos( Vector2 playerGps )
{
if(list_Pos.Count!=list_Obj.Count)
{
Debug.LogError(" RTK版本 提供的物体和提供的坐标数量不符 ");
return;
}
for (int i = 0; i < list_Obj.Count; i++)
{
Vector2 diff = list_Pos[i] - playerGps;
Vector3 playerPos = API_SVR.GetHead().position;
Vector3 pos = new Vector3(playerPos.x + diff.x, 0, playerPos.z + diff.y);
list_Obj[i].position = pos;
}
}
}