Exemple #1
0
 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);
 }
Exemple #2
0
        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);
                }
            }
        }
Exemple #3
0
        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);
        }
Exemple #4
0
 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;
 }