/// <summary> /// /// </summary> void ApplyUI() { KeyNameText.text = CachedData.Description; if (!CachedData.PrimaryIsAxis) { PrimaryKeyText.text = CachedData.PrimaryKey != KeyCode.None ? Regex.Replace(CachedData.PrimaryKey.ToString(), "[A-Z]", " $0").Trim() : "None"; } else { PrimaryKeyText.text = CachedData.PrimaryAxis; } if (!CachedData.AlternativeIsAxis) { AltKeyText.text = CachedData.AlternativeKey != KeyCode.None ? Regex.Replace(CachedData.AlternativeKey.ToString(), "[A-Z]", " $0").Trim() : "None"; } else { AltKeyText.text = CachedData.AlternativeAxis; } PrimaryOverlay.SetActive(false); AltOverlay.SetActive(false); }
/// <summary> /// /// </summary> public void OnEdit(bool primary) { if (UIManager.ChangeKeyFor(this)) { PrimaryOverlay.SetActive(primary); AltOverlay.SetActive(!primary); if (primary) { PrimaryKeyText.text = ""; } else { AltKeyText.text = ""; } waitingFor = primary ? 1 : 2; } }