示例#1
0
        public override void OnReceive(object message)
        {
            Entity entity = message as Entity;

            if (entity.neighbors != null)
            {
                if (entity.neighbors.entity.Count >= 1)
                {
                    List <TrackingUpdate> updates = new List <TrackingUpdate>();
                    foreach (Entity r in entity.neighbors.entity)
                    {
                        TrackingUpdate update = new TrackingUpdate(r.vector3.x, r.vector3.y, r.vector3.z);
                        update.entityId = r.id;
                        if (r.trackExtra != null)
                        {
                            update.trackExtra = r.trackExtra;
                        }


                        updates.Add(update);
                    }

                    updateReceived(updates);
                }
            }
        }
示例#2
0
        public void Update(TrackingUpdate update)
        {
            Entity entity = new Entity();

            entity.id         = "1";
            entity.entityType = update.entityType;

            entity.vector3   = new Vector3();
            entity.vector3.x = update.x;
            entity.vector3.y = update.y;
            entity.vector3.z = update.z;

            TrackEntity trackEntity = new TrackEntity();

            trackEntity.value = true;
            if (update.trackExtra != null)
            {
                trackEntity.trackExtra = update.trackExtra;
            }
            entity.trackEntity = trackEntity;

            entity.getNeighbors = CreateGetNeighbors(update.neighborEntityType, entity.vector3);


            ActorSystem.Instance.Find("/remote/default").Tell(entity);
        }