Ejemplo n.º 1
0
 public void SetEntity(World world, Entity entity)
 {
     World         = world;
     Entity        = entity;
     EntityManager = world.EntityManager;
     Container     = new EntityContainer(EntityManager, Entity);
     EditorUtility.SetDirty(this);
     OnEntitySelectionChanged?.Invoke(this);
 }
Ejemplo n.º 2
0
        internal void SetEntitySelection(Entity newSelection, bool updateList)
        {
            if (updateList)
            {
                entityListView.SetEntitySelection(newSelection);
            }

            var world = WorldSelection ?? (SystemSelection as ComponentSystemBase)?.World;

            if (world != null && newSelection != Entity.Null)
            {
                selectionProxy.SetEntity(world, newSelection);
                Selection.activeObject = selectionProxy;
                OnEntitySelectionChanged?.Invoke(selectionProxy);
            }
            else if (Selection.activeObject == selectionProxy)
            {
                Selection.activeObject = null;
                OnEntitySelectionChanged?.Invoke(null);
            }
        }