private void OnSelectionChanging(object sender, RuntimeSelectionChangingArgs e)
        {
            var selected = e.Selected;

            for (int i = selected.Count - 1; i >= 0; i--)
            {
                GameObject     go      = (GameObject)selected[i];
                ExposeToEditor exposed = go.GetComponent <ExposeToEditor>();
                ExposeToEditor parent  = exposed.GetParent();
                if (parent != null)
                {
                    selected.Add(parent.gameObject);
                    selected.RemoveAt(i);
                }
            }
        }
Esempio n. 2
0
        private void OnSelectionChanging(object sender, RuntimeSelectionChangingArgs e)
        {
            if (SelectObjectsMode)
            {
                return;
            }

            IList <UnityObject> selected = e.Selected;

            for (int i = selected.Count - 1; i >= 0; i--)
            {
                if (!m_handleToKey.ContainsKey(selected[i] as GameObject))
                {
                    selected.RemoveAt(i);
                }
            }
        }
Esempio n. 3
0
        private void OnSelectionChanging(object sender, RuntimeSelectionChangingArgs e)
        {
            if (m_editor.Tools.Custom is EditorType)
            {
                EditorType editorType = (EditorType)m_editor.Tools.Custom;
                if (editorType != EditorType.Empty)
                {
                    IRuntimeSelectionComponent component = (IRuntimeSelectionComponent)sender;
                    RaycastHit[] hits = Physics.RaycastAll(component.Window.Pointer);

                    if (Terrain != null && hits.Any(hit => hit.collider.gameObject == Terrain.gameObject))
                    {
                        e.Cancel = true;
                    }
                }
            }
        }