コード例 #1
0
    public bool SelectEntity(DCLBuilderInWorldEntity entityEditable)
    {
        if (entityEditable.IsLocked)
        {
            return(false);
        }

        if (entityEditable.IsSelected)
        {
            return(false);
        }

        entityEditable.Select();

        selectedEntities.Add(entityEditable);

        currentActiveMode?.SelectedEntity(entityEditable);

        if (HUDController.i.builderInWorldMainHud != null)
        {
            hudController.UpdateEntitiesSelection(selectedEntities.Count);
            hudController.ShowEntityInformation();
            hudController.EntityInformationSetEntity(entityEditable, sceneToEdit);
        }

        outlinerController.CancelAllOutlines();

        OnEntitySelected?.Invoke();

        return(true);
    }
コード例 #2
0
    public void DeselectEntity(DCLBuilderInWorldEntity entity)
    {
        if (!selectedEntities.Contains(entity))
        {
            return;
        }

        entity.Deselect();

        outlinerController.CancelEntityOutline(entity);
        selectedEntities.Remove(entity);
        hudController?.UpdateEntitiesSelection(selectedEntities.Count);
        currentActiveMode?.EntityDeselected(entity);
        if (selectedEntities.Count <= 0 &&
            hudController != null)
        {
            hudController.HideEntityInformation();
        }

        OnEntityDeselected?.Invoke(entity);
    }