コード例 #1
0
ファイル: PaintRailTool.cs プロジェクト: hhy5277/dwarfcorp
        public override void OnVoxelsSelected(List <VoxelHandle> voxels, InputManager.MouseButton button)
        {
            if (!Dragging)
            {
            }
            else
            {
                if (button == InputManager.MouseButton.Left)
                {
                    if (CanPlace)
                    {
                        RailHelper.Place(World, PreviewBodies, GodModeSwitch);
                    }
                    else
                    {
                        foreach (var piece in PreviewBodies)
                        {
                            piece.GetRoot().Delete();
                        }
                    }

                    PreviewBodies.Clear();
                    PathVoxels.Clear();
                    Dragging = false;
                }
            }
        }
コード例 #2
0
 public override void OnVoxelsSelected(List <VoxelHandle> voxels, InputManager.MouseButton button)
 {
     if (button == InputManager.MouseButton.Left)
     {
         if (RailHelper.CanPlace(Player, PreviewBodies))
         {
             RailHelper.Place(Player, PreviewBodies, GodModeSwitch);
             PreviewBodies.Clear();
             CreatePreviewBodies(Player.World.ComponentManager, Player.VoxSelector.VoxelUnderMouse);
         }
     }
 }