private void OnCursorStatusChanged(object sender, CursorUpdatedArgs args)
        {
            switch (args.current)
            {
                case ConstructionGrid.CursorStatuses.Holding:
                    // edit
                    buttons[0].buttons[1].isEnabled = true;
                    pickupPlaceLabel.text = Place;
                    buttons[0].buttons[0].isEnabled = true;
                    break;

                case ConstructionGrid.CursorStatuses.Hover:
                    // edit
                    buttons[0].buttons[1].isEnabled = true;
                    pickupPlaceLabel.text = Pickup;
                    buttons[0].buttons[0].isEnabled = false;
                    break;

                case ConstructionGrid.CursorStatuses.None:
                    // edit
                    buttons[0].buttons[1].isEnabled = false;
                    buttons[0].buttons[0].isEnabled = false;
                    break;
            }
        }
示例#2
0
 private void OnCursorStatusChanged(object sender, CursorUpdatedArgs args)
 {
     UpdateSampleButton();
     UpdatePaintButton();
 }
示例#3
0
        private void OnCursorUpdated(object sender, CursorUpdatedArgs args)
        {
            ConstructionGrid grid = (ConstructionGrid)sender;
            CUBEInfo info;
            switch (args.current)
            {
                case ConstructionGrid.CursorStatuses.Holding:
                    info = grid.heldInfo;
                    description.SetActive(info.type != CUBE.Types.System);
                    stats.SetActive(info.type == CUBE.Types.System);
                    break;

                case ConstructionGrid.CursorStatuses.Hover:
                    info = grid.HoverInfo;
                    description.SetActive(info.type != CUBE.Types.System);
                    stats.SetActive(info.type == CUBE.Types.System);
                    break;

                default:
                    Blank();
                    return;
            }

            SetStats(info);
        }