示例#1
0
 void EntitySelectionChanged(Entity entity, World _world, ComponentType type)
 {
     if (type.GetManagedType() == typeof(Entity))
     {
         if (_world.EntityManager != null)
         {
             selectionEntityProxy.SetEntity(_world, entity);
         }
         if (Selection.activeObject != selectionEntityProxy)
         {
             Selection.activeObject = selectionEntityProxy;
         }
     }
     else
     {
         if (_world.EntityManager == null)
         {
             return;
         }
         if (type.GetManagedType() == typeof(MonoBehaviour) &&
             type.GetManagedType() == typeof(ScriptableObject))
         {
             return;
         }
         var obj = _world.EntityManager.GetComponentFromType(entity, type);
         ObjectSelectionChanged(type, ref obj);
     }
 }
 public void SetEntitySelection(uint? entityId)
 {
     EntitySelectionId = entityId;
     var entity = GetSelectionEntity();
     if (entity == null)
     {
         Selection.activeObject = null;
     }
     else
     {
         selectionProxy.SetEntity(GetSelectionEntity);
         Selection.activeObject = selectionProxy;
     }
     ReloadAll();
 }
    private void SelectEntity()
    {
        Entity selectedEntity = new Entity()
        {
            Index = ColorToIndex(GetColorAtMousePos(_mousePos, _objectIdTexture))
        };

        if (_entityIndexToMat.ContainsKey(selectedEntity.Index))
        {
            selectedEntity.Version = _entityIndexToMat[selectedEntity.Index].Version;
            CurrentSelectedEntityProxy.SetEntity(World, selectedEntity);

            Selection.activeObject = CurrentSelectedEntityProxy;
        }
        else
        {
            Selection.activeObject = null;
        }
    }
    private void SelectEntity()
    {
        var selectedEntity = new Entity
        {
            Index = ColorToIndex(GetColorAtMousePos(_clickedMousePos, _objectIDRenderTarget))
        };

        if (_entityIndexToMat.ContainsKey(selectedEntity.Index))
        {
            selectedEntity.Version = _entityIndexToMat[selectedEntity.Index].Version;
            CurrentSelectedEntityProxy.SetEntity(World, selectedEntity);

            Selection.activeObject = CurrentSelectedEntityProxy;
        }
        else
        {
            Selection.activeObject = null;
        }
    }