当前位置: 首页>>代码示例>>C#>>正文


C# Input.mousedown方法代码示例

本文整理汇总了C#中Input.mousedown方法的典型用法代码示例。如果您正苦于以下问题:C# Input.mousedown方法的具体用法?C# Input.mousedown怎么用?C# Input.mousedown使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Input的用法示例。


在下文中一共展示了Input.mousedown方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnRaycastHitchanged

        public bool OnRaycastHitchanged(Input input, QbMatrix matrix, RaycastHit hit, ref Colort color, MouseButtonEventArgs e)
        {
            if ((e != null && e.IsPressed && e.Button == MouseButton.Left) || (e == null && input.mousedown(MouseButton.Left)))
            {
                QbMatrix mat = Singleton<QbManager>.INSTANCE.ActiveModel.matrices[hit.matrixIndex];
                if (mat != null)
                {
                    Voxel voxel;
                    if (mat.voxels.TryGetValue(mat.GetHash(hit.x, hit.y, hit.z), out voxel))
                    {
                        for (int i = 0; i < 10; i++)
                        {
                            var colorpal = Singleton<GUI>.INSTANCE.Get<EmptyWidget>(GUIID.START_COLOR_SELECTORS + i);

                            if ((bool)colorpal.customData["active"])
                            {
                                colorpal.appearence.Get<PlainBackground>("background").color = mat.colors[voxel.colorindex];
                                Singleton<GUI>.INSTANCE.Dirty = true;

                                Singleton<BrushManager>.INSTANCE.brushColor = mat.colors[voxel.colorindex];

                                Color4 colorr = mat.colors[voxel.colorindex];
                                Singleton<Broadcaster>.INSTANCE.Broadcast(Message.ColorSelectionChanged, colorpal, colorr);
                            }
                        }
                    }
                }
                return true;
            }
            return false;
        }
开发者ID:law4x,项目名称:stonevox3d,代码行数:31,代码来源:BrushColorSelection.cs

示例2: OnRaycastHitchanged

        public bool OnRaycastHitchanged(Input input, QbMatrix matrix, RaycastHit hit, ref Colort color, MouseButtonEventArgs e)
        {
            lastmatrix = matrix;
            switch (state)
            {
                case ToolState.Start:
                    if ((e != null && e.IsPressed && e.Button == MouseButton.Left) || (e == null && input.mousedown(MouseButton.Left)))
                    {
                        state = ToolState.Base;
                        Singleton<Raycaster>.INSTANCE.testdirt = true;
                        startPosition = new VoxelLocation(hit, false);
                        endPosition = new VoxelLocation(hit, false);
                        volume = new VoxelVolume(startPosition, endPosition);
                        modifiedVoxels.Clear();
                        EnumerateVolume(volume, lastvolume, matrix, ref color, modifiedVoxels);
                        lastvolume = volume;
                        return true;
                    }
                    break;
                case ToolState.Base:
                    if ((e != null && e.IsPressed && e.Button == MouseButton.Left) || (e == null && input.mousedown(MouseButton.Left)))
                    {
                        endPosition = new VoxelLocation(hit, false);
                        volume = new VoxelVolume(startPosition, endPosition);

                        EnumerateVolume(volume, lastvolume, matrix, ref color, modifiedVoxels);
                        CleanLastVolume(lastvolume, volume, matrix, modifiedVoxels);
                        lastvolume = volume;

                        return true;
                    }
                    else if ((e != null && !e.IsPressed && e.Button == MouseButton.Left) || (e == null && input.mouseup(MouseButton.Left)))

                    {
                        state = ToolState.Start;
                        lastvolume = VoxelVolume.NEGATIVE_ZERO;
                        Singleton<UndoRedo>.INSTANCE.AddUndo(BrushType, matrix, volume, color, modifiedVoxels);
                        return true;
                    }
                    break;
                case ToolState.Limit:
                    break;
            }
            return false;
        }
开发者ID:law4x,项目名称:stonevox3d,代码行数:45,代码来源:BrushRemove.cs


注:本文中的Input.mousedown方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。