private void UnlockSuccessfully(IAppLockingSystem app) { Debug.Log("unlocked"); app.LockingState = false; _lockingPanel.Unlock(); Observable.Timer(TimeSpan.FromSeconds(3)).Subscribe(x => LoadNewScene(app)); }
public bool CheckApp(IAppLockingSystem app, PasswordPanelView prefab, GameObject parent) { if (app.LockingState) { StartUnlockingProcess(app, prefab, parent); return(true); } return(false); }
public void LoadScene(IAppSceneLoading app, IAppLockingSystem lockingApp) { if (!_passwordController.CheckApp(lockingApp, _prefabListObject.PasswordPanelPrefab, _canvas)) { var operation = SceneManager.LoadSceneAsync(app.Scene.name, LoadSceneMode.Additive); operation.completed += _ => { SceneManager.SetActiveScene(SceneManager.GetSceneByName(app.Scene.name)); }; _mainScreenObjects.SetActive(false); } }
public void CreatePasswordPanel(IAppLockingSystem app) { Password = _inputtext.ObserveEveryValueChanged(text => text.text).ToReactiveProperty(); }
private void LoadNewScene(IAppLockingSystem app) { _lockingPanel.Destroy(); AppController.Instance.LoadScene(app.Name); }
private void StartUnlockingProcess(IAppLockingSystem app, PasswordPanelView prefab, GameObject parent) { _lockingPanel = Object.Instantiate(prefab, parent.transform); _lockingPanel.CreatePasswordPanel(app); _lockingPanel.Password.Where(x => x.Equals(app.Password)).Subscribe(x => UnlockSuccessfully(app)).AddTo(_lockingPanel); }