示例#1
0
    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);
        }
    }
示例#2
0
    /// <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);
        }
    }