Esempio n. 1
0
        public void ToggleSelecion(BonsaiNode node)
        {
            if (IsNodeSelected(node))
            {
                selectedNodes.Remove(node);
            }
            else
            {
                selectedNodes.Add(node);
            }

            if (IsSingleSelection)
            {
                BonsaiNode selectedNode = SingleSelectedNode;
                Selection.objects      = null;
                Selection.activeObject = selectedNode.Behaviour;
                SingleSelected?.Invoke(this, selectedNode);
                NotifyIfAbortSelected(selectedNode);
                SelectReferencedNodes(selectedNode);
            }

            else if (IsMultiSelection)
            {
                Selection.objects = selectedNodes.Select(n => n.Behaviour).ToArray();
            }
        }
 public void SetSingleSelection(BonsaiNode newSingleSelected)
 {
     selectedNodes.Clear();
     selectedNodes.Add(newSingleSelected);
     Selection.objects      = null;
     Selection.activeObject = newSingleSelected.Behaviour;
     SingleSelected?.Invoke(this, newSingleSelected);
     SelectReferencedNodes(newSingleSelected);
 }
        public void SetSingleSelection(BonsaiNode newSingleSelected)
        {
            selectedNodes.Clear();
            selectedNodes.Add(newSingleSelected);
#if UNITY_2019_1_OR_NEWER
            Selection.objects = null;
#endif
            Selection.activeObject = newSingleSelected.Behaviour;
            SingleSelected?.Invoke(this, newSingleSelected);
            //SelectReferencedNodes(newSingleSelected);
        }