Example #1
0
        internal override void OnComponentAddedToLayer(Component component)
        {
            base.OnComponentAddedToLayer(component);
            Entity e = component as Entity;

            if (e != null)
            {
                TilePosition tp = e.GetComponentByType <TilePosition>();
                if (tp == null)
                {
                    e.AddComponent(tp = new TilePosition(this));
                }
                else
                {
                    tp.SetIntegrater(this);
                }
                this.positions[e] = tp;
            }
        }
Example #2
0
 internal override void OnComponentAddedToLayer(Component component)
 {
     base.OnComponentAddedToLayer(component);
     Entity e = component as Entity;
     if ( e != null )
     {
         TilePosition tp = e.GetComponentByType<TilePosition>();
         if (tp == null)
             e.AddComponent(tp = new TilePosition(this));
         else
             tp.SetIntegrater(this);
         this.positions[e] = tp;
     }
 }