Beispiel #1
0
        public EventManager.EventResult handleAttributeUpdate(Event e)
        {
            PositionChangeEvent em = e as PositionChangeEvent;

            if (em != null)
            {
                //is this an entity we are tracking
                OctreeElement <Entity> el;
                if (theOctreeEntityMap.TryGetValue(em.entity, out el))
                {
                    if (convertPosition(ref el, em.position) == true)
                    {
                        theOctree.update(el);
                    }
                    return(EventManager.EventResult.HANDLED);
                }
            }

            return(EventManager.EventResult.IGNORED);
        }
        public static void dispatchAttributeChange(Entity e, object att)
        {
            PositionChangeEvent evt = new PositionChangeEvent(e.id, (Vector3)att);

            Kernel.eventManager.queueEvent(evt);
        }