private static void UpdateSelection(Object[] existingSelection, Object newObject, SelectionType type, bool isRectSelection) { Object[] objArray; if (newObject == null) { objArray = new Object[0]; } else { objArray = new Object[] { newObject }; } UpdateSelection(existingSelection, objArray, type, isRectSelection); }
private void TryOneClickDrag() { EventType type = Event.current.type; if (type == EventType.MouseDown) { UnityEngine.Object @object = HandleUtility.PickGameObject(Event.current.mousePosition, true); if (@object) { GameObject gameObject = @object as GameObject; bool flag = false; GameObject[] gameObjects = Selection.gameObjects; for (int i = 0; i < gameObjects.Length; i++) { GameObject y = gameObjects[i]; if (gameObject == y) { flag = true; break; } } if (!flag && gameObject.GetComponent <SpriteRenderer>() != null) { RectSelection.UpdateSelection(this.m_SelectionStart, @object, RectSelection.SelectionType.Normal, this.m_RectSelecting); SceneView.lastActiveSceneView.m_OneClickDragObject = @object; Event.current.Use(); } } } }