public void RecvData(SyncData data) { int notnull = (int)data.Get(typeof(int)); //时间 delta = Time.time - lastRecvInfoTime; foreach (var ai in AI_List) { string id = data.GetString(); if (AI_List.ContainsKey(id)) { //无预测同步 //AI_List[id].transform.position = (Vector3)data.Get(typeof(Vector3)); //AI_List[id].transform.eulerAngles = (Vector3)data.Get(typeof(Vector3)); //预测同步 Vector3 nPosition = (Vector3)data.Get(typeof(Vector3)); Vector3 nRotation = (Vector3)data.Get(typeof(Vector3)); //Debug.Log("RecvData" + id); NetForecastInfo(id, nPosition, nRotation); } else { data.Get(typeof(Vector3)); data.Get(typeof(Vector3)); } } lastRecvInfoTime = Time.time; }