Fix input source description.
This commit is contained in:
@@ -39,6 +39,9 @@ namespace Cryville.Common.Unity.Input {
|
|||||||
public override int GetHashCode() {
|
public override int GetHashCode() {
|
||||||
return Handler.GetHashCode() ^ Type;
|
return Handler.GetHashCode() ^ Type;
|
||||||
}
|
}
|
||||||
|
public override string ToString() {
|
||||||
|
return string.Format("{0}:{1}", ReflectionHelper.GetSimpleName(Handler.GetType()), Handler.GetTypeName(Type));
|
||||||
|
}
|
||||||
public static bool operator ==(InputSource lhs, InputSource rhs) {
|
public static bool operator ==(InputSource lhs, InputSource rhs) {
|
||||||
return lhs.Equals(rhs);
|
return lhs.Equals(rhs);
|
||||||
}
|
}
|
||||||
|
@@ -85,10 +85,10 @@ namespace Cryville.Common.Unity.Input {
|
|||||||
public class UnityMouseButtonReceiver : UnityKeyReceiver<UnityMouseButtonReceiver> {
|
public class UnityMouseButtonReceiver : UnityKeyReceiver<UnityMouseButtonReceiver> {
|
||||||
public override string GetKeyName(int type) {
|
public override string GetKeyName(int type) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 0: return "Left";
|
case 0: return "Mouse Left";
|
||||||
case 1: return "Right";
|
case 1: return "Mouse Right";
|
||||||
case 2: return "Middle";
|
case 2: return "Mouse Middle";
|
||||||
default: return string.Format("Button {0}", type);
|
default: return string.Format("Mouse Button {0}", type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void OnGUI() {
|
void OnGUI() {
|
||||||
|
@@ -39,7 +39,7 @@ namespace Cryville.Common.Unity.Input {
|
|||||||
|
|
||||||
public override string GetTypeName(int type) {
|
public override string GetTypeName(int type) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 0: return "Unity Mouse";
|
case 0: return "Mouse Position";
|
||||||
default: throw new ArgumentOutOfRangeException(nameof(type));
|
default: throw new ArgumentOutOfRangeException(nameof(type));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -39,7 +39,7 @@ namespace Cryville.Common.Unity.Input {
|
|||||||
|
|
||||||
public override string GetTypeName(int type) {
|
public override string GetTypeName(int type) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 0: return "Unity Touch";
|
case 0: return "Touch";
|
||||||
default: throw new ArgumentOutOfRangeException(nameof(type));
|
default: throw new ArgumentOutOfRangeException(nameof(type));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user