Go back to C# stoneage to please Unity

This commit is contained in:
Andy Chabalier 2018-05-31 13:18:13 +02:00
parent 7bf9f39301
commit bf5855afa3
2 changed files with 76 additions and 25 deletions

View File

@ -110,7 +110,11 @@ namespace SpaceNavWrapper
#region Properties #region Properties
public double Sensitivity public double Sensitivity
{ {
get => _sensitivity; get
{
return _sensitivity;
}
set set
{ {
_sensitivity = value; _sensitivity = value;
@ -120,7 +124,11 @@ namespace SpaceNavWrapper
public int Threshold public int Threshold
{ {
get => _threshold; get
{
return _threshold;
}
set set
{ {
_threshold = value; _threshold = value;
@ -130,16 +138,20 @@ namespace SpaceNavWrapper
public bool Nonblocking public bool Nonblocking
{ {
get => _nonblocking; get
{
return _nonblocking;
}
set set
{ {
_nonblocking = value; _nonblocking = value;
spnav_set_nonblocking(value); spnav_set_nonblocking(value);
} }
} }
#endregion #endregion
public void Dispose() public void Dispose()
{ {
if (!isDisposed) if (!isDisposed)
{ {

View File

@ -13,23 +13,62 @@ namespace SpaceNavWrapper
public MotionEventArgs(int x, int y, int z, int rx, int ry, int rz) public MotionEventArgs(int x, int y, int z, int rx, int ry, int rz)
{ {
axisValues = new Dictionary<SpaceNavAxis, int> axisValues = new Dictionary<SpaceNavAxis, int>();
{ axisValues[SpaceNavAxis.X] = x;
[SpaceNavAxis.X] = x, axisValues[SpaceNavAxis.Y] = y;
[SpaceNavAxis.Y] = y, axisValues[SpaceNavAxis.Z] = y;
[SpaceNavAxis.Z] = y, axisValues[SpaceNavAxis.Rx] = rx;
[SpaceNavAxis.Rx] = rx, axisValues[SpaceNavAxis.Ry] = ry;
[SpaceNavAxis.Ry] = ry, axisValues[SpaceNavAxis.Rz] = rz;
[SpaceNavAxis.Rz] = rz
};
} }
public int X => axisValues[SpaceNavAxis.X]; public int X
public int Y => axisValues[SpaceNavAxis.Y]; {
public int Z => axisValues[SpaceNavAxis.Z]; get
public int Rx => axisValues[SpaceNavAxis.Rx]; {
public int Ry => axisValues[SpaceNavAxis.Ry]; return axisValues[SpaceNavAxis.X];
public int Rz => axisValues[SpaceNavAxis.Rz]; }
}
public int Y
{
get
{
return axisValues[SpaceNavAxis.Y];
}
}
public int Z
{
get
{
return axisValues[SpaceNavAxis.Z];
}
}
public int Rx
{
get
{
return axisValues[SpaceNavAxis.Rx];
}
}
public int Ry
{
get
{
return axisValues[SpaceNavAxis.Ry];
}
}
public int Rz
{
get
{
return axisValues[SpaceNavAxis.Rz];
}
}
public override string ToString() public override string ToString()
{ {