private void UnlockOldCode(string oldCode) { if (oldCode.Equals(userCode)) { oldCodeUnlocked = true; oldCodeText.gameObject.SetActive(false); newCodeText.gameObject.SetActive(true); keyPanel.ResetKeySystem(); keyPanel.OnCodeAccess -= UnlockOldCode; keyPanel.OnCodeAccess += SetNewCode; } else { keyPanel.ResetKeySystem(); MainCanvas.Instance.SendNotification(NotificationType.WrongPassword); } }
/// <summary> /// Try to match inputKey with userKey. If success, unlock data access. /// </summary> private void UnlockData(string inputKey) { #if DEBUG Debug.Log("Matching user key with registered key..."); Debug.Log(inputKey); #endif if (inputKey.Equals(userCode)) { DataManager.IsUnlocked = true; OnUnlock?.Invoke(); gameObject.SetActive(false); } else { keyPanel.ResetKeySystem(); MainCanvas.Instance.SendNotification(NotificationType.WrongPassword); } }