提交无人机同步
This commit is contained in:
parent
50f0a8193e
commit
6caee0cc20
|
@ -178,6 +178,13 @@ public class GameManager : MonoBehaviour
|
|||
break;
|
||||
case "offline":
|
||||
break;
|
||||
case "WRJPosAngle":
|
||||
EquipmentCommon equipmentCommon = EquipmentCommon.equipmentCommons.Find(x => x.deviceID == data[1]);
|
||||
if (equipmentCommon)
|
||||
{
|
||||
equipmentCommon.ReceivingPositionAngle(data);
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -185,9 +185,10 @@ public class EquipmentCommon : MonoBehaviour
|
|||
}
|
||||
protected string GetSyncData()
|
||||
{
|
||||
return string.Format("{0},{1},{2},{3},{4},{5},{6}", equipmentCommon.deviceID, transform.position.x, transform.position.y, transform.position.z, transform.eulerAngles.x, transform.eulerAngles.y, transform.eulerAngles.z);
|
||||
return string.Format("{0},{1},{2},{3},{4},{5},{6},{7}", "WRJPosAngle", equipmentCommon.deviceID, transform.position.x, transform.position.y, transform.position.z, transform.eulerAngles.x, transform.eulerAngles.y, transform.eulerAngles.z);
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void Update()
|
||||
{
|
||||
|
@ -196,6 +197,18 @@ public class EquipmentCommon : MonoBehaviour
|
|||
isPlayer = !isPlayer;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
public void ReceivingPositionAngle(string[] data)
|
||||
{
|
||||
Vector3 pos = new Vector3(float.Parse(data[2]), float.Parse(data[3]), float.Parse(data[4]));
|
||||
Vector3 rot = new Vector3(float.Parse(data[4]), float.Parse(data[6]), float.Parse(data[7]));
|
||||
transform.position = pos;
|
||||
transform.position = rot;
|
||||
}
|
||||
}
|
||||
|
||||
public enum SelectedSide
|
||||
|
|
|
@ -440,8 +440,6 @@ public class UnmannedAerialVehicleManage : MonoBehaviour
|
|||
isMove = true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
public enum Pattern
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue