コード例 #1
0
        private void OnStartSelectionArea()
        {
            var worldPoint = Systems.Input.MouseWorldPoint;

            selectionBuilder = new SelectionBuilder(worldPoint);
            GameSystems.UI.gameplayLayer.selectionArea.Show(worldPoint);
        }
コード例 #2
0
        private void OnEndSelectionArea()
        {
            if (IsSelectingArea)
            {
                // Clear the current selection
                CurrentSelection?.Clear();

                // Update selection builder
                var worldPoint = Systems.Input.MouseWorldPoint;
                selectionBuilder.UpdateSelection(worldPoint);

                // Hide the selection area overlay
                GameSystems.UI.gameplayLayer.selectionArea.Hide();

                // Get the selection and save it in the hotbar if possible
                var selection = selectionBuilder.Build();

                CurrentSelection = selection;
                selectionBuilder = null;
            }
        }