public TagYarnDialogSelector(Yarn.VariableStorage variableStorage) { VariableStorage = variableStorage; Dialogue = new Yarn.Dialogue(VariableStorage) { LogDebugMessage = delegate(string message) { DebugLog.Log(message); }, LogErrorMessage = delegate(string message) { DebugLog.Err(message); } }; }
private void LoadDialogueString(string fileContent) { try { dialogue.LoadString(fileContent); } catch (InvalidOperationException e) { DebugLog.Err(e); } }
public YarnDialogSelector() { variableStorage = new Yarn.MemoryVariableStore(); dialogue = new Yarn.Dialogue(variableStorage) { LogDebugMessage = delegate(string message) { DebugLog.Log(message); }, LogErrorMessage = delegate(string message) { DebugLog.Err(message); } }; }
public void UiConnect() { if (!_username || !_password) { DebugLog.Err("Username or Password Input Field missing."); return; } if (ConnectFunction != null) { ConnectFunction(_username.text, _password.text); if (_loadingTextObj && _confirmButtonObj) { _loadingTextObj.SetActive(true); _confirmButtonObj.SetActive(false); } Error = null; } }
private IList <string> ReadFiles(string[] files) { IList <string> filesContent = new List <string>(); foreach (string file in files) { string filepath = file; #if UNITY_STANDALONE_OSX filepath = filepath.Replace("file://", ""); filepath = filepath.Replace("%20", " "); #endif try { var content = File.ReadAllText(filepath); filesContent.Add(content); } catch (System.Exception ex) { DebugLog.Err("Unable to read file.\n" + ex.Message); } } return(filesContent); }
public ShowResult Show() { // var storage = PersistentDataStorage.Instance; // var state = storage.GetState(); if (!MenuPrefab) { DebugLog.Warn("Unable to show Login Menu. No menu prefab set."); return(ShowResult.FAIL); } if (_control == null) { _control = new Control(MenuPrefab); } var result = _control.Show(); if (result == ShowResult.FAIL) { DebugLog.Warn("Unable to show Activity Menu."); return(result); } if (result == ShowResult.FIRST) { _hook = _control.Instance.GetComponent <LoginHook>(); if (!_hook) { DebugLog.Warn("Unable to retrieve Login Hook."); return(ShowResult.FAIL); } } _hook.Title = "Moodle Login"; _hook.ConnectFunction = (username, password) => { DebugLog.Log("Login made with username " + username + " and password " + password); if (!_webManager) { DebugLog.Err("Web Manager not defined."); return; } _webManager.Login(username, password, success => { DebugLog.Log("Logged in successefully? " + success.ToString()); if (!success) { _hook.CompleteLogin("O nome de utlizador ou password estão incorrectos."); return; } var state = PersistentDataStorage.Instance.GetState(); state["UserID"] = username; PersistentDataStorage.Instance.SaveState(); Disable(); // _webManager.RetrieveData(username, (percentage, message) => // { // DebugLog.Log("Progress: " + percentage * 100f + " | " + message); // if (percentage == 1f) // { // _hook.CompleteLogin(); // Disable(); // } // }); }); }; return(result); }