void OnKeyPressed(string input) { if (selectedButton == this) { switch (input) { case ("Right"): if (RightFunction.FuncName != "") { SendMessage(RightFunction.FuncName, RightFunction.FuncArg); } if (Right != null) { Right.Select(); } break; case ("Left"): if (LeftFunction.FuncName != "") { SendMessage(LeftFunction.FuncName, LeftFunction.FuncArg); } if (Left != null) { Left.Select(); } break; case ("Up"): if (UpFunction.FuncName != "") { SendMessage(UpFunction.FuncName, UpFunction.FuncArg); } if (Up != null) { Up.Select(); } break; case ("Down"): if (DownFunction.FuncName != "") { SendMessage(DownFunction.FuncName, DownFunction.FuncArg); } if (Down != null) { Down.Select(); } break; case ("Attack"): if (ConfirmFunction.FuncName != "") { SendMessage(ConfirmFunction.FuncName, ConfirmFunction.FuncArg); } break; case ("Special"): if (CancelFunction.FuncName != "") { SendMessage(CancelFunction.FuncName, CancelFunction.FuncArg); } break; default: break; } } if (Input.GetKeyDown(KeyCode.Escape)) { if (CancelFunction.FuncName != "") { SendMessage(CancelFunction.FuncName, CancelFunction.FuncArg); } } }
public void SelectLast() { Last.Select(); }