本文整理汇总了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;
}
示例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;
}