public void RestoreLog(Programmator prog) { if (m_isVisible && LogText != null) { LogText.text = prog.LogHistory; LogScrollbar.value = 0.0f; } }
public void Log(Programmator prog, string message) { // write log only if menu is visible and only for selected programmer if (m_isVisible && LogText != null && prog == m_currentProgrammer) { LogText.text += '\n' + message; // move scroll handler to the bottom // take a value lower than 0 because the content // rectangle is not expanded yet, so after // its expansion current position will no be in the // very end of the log LogScrollbar.value = -1.0f; } }
public void ShowFor(Programmator prog) { m_currentProgrammer = prog; SetProgrammerLabel("Programmable Unit " + prog.Id); SetCurrentScriptLabel(prog.CurrentScript); SetFreqSliderValue(prog.Frequency); SetFreqLabelValue(prog.Frequency.ToString()); SetToggleState(prog.IsActive); // make the toggle interactable if we have script bool programmerHasScript = !string.IsNullOrEmpty(prog.CurrentScript); SetToggleActive(programmerHasScript); UpdateScriptList(); UpdatePortListData(); Show(); RestoreLog(prog); }