Example #1
0
 public void UpdateCurrentDisplayPanel(EntityDisplayPanel displayPanel)
 {
     if (displayPanel == null)
     {
         if (!_defaultDisplayPanel.gameObject.activeInHierarchy)
         {
             _defaultDisplayPanel.gameObject.SetActive(true);
             _defaultDisplayPanel.Show();
         }
     }
     else
     {
         if (_defaultDisplayPanel.gameObject.activeInHierarchy)
         {
             _defaultDisplayPanel.Hide();
             _defaultDisplayPanel.gameObject.SetActive(false);
         }
     }
 }
Example #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);
    }