public static AgentTrackData Vector3ToAgentTrackData(Vector3 vec, AgentTrackData agentTrackData) { agentTrackData.x = FloatToInt(vec.x); agentTrackData.y = FloatToInt(vec.y); agentTrackData.z = FloatToInt(vec.z); return(agentTrackData); }
private void SendTrackDatas(AgentTrackData agentTrackData) { if (agentTrackData.trackData.Count > 0) { Entity entity = new Entity(); entity.id = "0"; entity.agentTrackData = agentTrackData; if (ActorSystem.instance.client != null) { ActorSystem.instance.client.SendEntity(entity); } } }
public void UpdateTracking() { AgentTrackData agentTrackData = new AgentTrackData(); int count = 0; foreach (IGameEntity gameEntity in gameEntities) { TrackData trackData = gameEntity.GetTrackData(); trackData.id = gameEntity.GetEntityId(); trackData.entityType = TrackData.EntityType.Npc; agentTrackData.trackData.Add(trackData); count++; if (count > 30) { SendTrackDatas(agentTrackData); agentTrackData = new AgentTrackData(); count = 0; } } SendTrackDatas(agentTrackData); }
public static AgentTrackData Vector3ToAgentTrackData(Vector3 vec, AgentTrackData agentTrackData) { agentTrackData.x = FloatToInt(vec.x); agentTrackData.y = FloatToInt(vec.y); agentTrackData.z = FloatToInt(vec.z); return agentTrackData; }