public bool SetKey(KeyCode key, string description) { //Debug.Log("Set key " + key.ToString() + " in " + name); Reset(); DescriptionLabel.enabled = true; DescriptionLabel.text = description; KeystrokeLabel.enabled = true; KeystrokeSprite.enabled = true; KeystrokeLabel.transform.localPosition = KeystrokeLabelPosition; bool wideFormat; string text = string.Empty; InterfaceActionManager.GetKeyCodeLabelText(key, false, out text, out wideFormat); if (wideFormat) { KeystrokeSprite.transform.localScale = WideKeystrokeScale; } else { KeystrokeSprite.transform.localScale = ThinKeystrokeScale; } KeystrokeLabel.text = text; return(true); }
public void Refresh() { ActionName.text = mSetting.ActionDescription; string text = string.Empty; bool wideFormat = false; if (mSetting.AxisSetting) { InterfaceActionManager.GetKeyCodeLabelText(mSetting.KeyX, true, out text, out wideFormat); KeyAxis1Binding.text = text.Replace("None", ""); InterfaceActionManager.GetKeyCodeLabelText(mSetting.KeyY, true, out text, out wideFormat); KeyAxis2Binding.text = text.Replace("None", ""); } else { InterfaceActionManager.GetKeyCodeLabelText(mSetting.Key, true, out text, out wideFormat); KeyBinding.text = text.Replace("None", ""); } ControllerBinding.text = mSetting.Controller.ToString().Replace("None", ""); MouseBinding.text = mSetting.Mouse.ToString().Replace("None", ""); }