Exemplo n.º 1
0
    public ImUiController(SelectionManager selectionManager, WorldData worldData)
    {
        _defaultDisplayPanel = Object.Instantiate(worldData.DefaultDisplayPanel);
        _defaultDisplayPanel.Initialize(selectionManager, null);

        _selectionManager = selectionManager;
        _selectionManager.SelectionUpdated += OnSelectionUpdated;
    }
Exemplo n.º 2
0
    public void OnSelectionUpdated()
    {
        ClearEntityDisplayPanel();

        var entity = default(Entity);

        if (_selectionManager.SelectedEntities.Count == 1)
        {
            entity = _selectionManager.SelectedEntities.First();
        }

        if (entity != null && entity.GetDisplayPanelPrefab() != null)
        {
            _currentDisplayPanel = Object.Instantiate(entity.GetDisplayPanelPrefab());
            _currentDisplayPanel.Initialize(_selectionManager, entity);
            _currentDisplayPanel.Show();
        }

        UpdateCurrentDisplayPanel(_currentDisplayPanel);
    }