void Init() { gearMenuButton = GearMenu.Buttons.Add(Name, this, Icon.Png, (go) => { Toggle(); }); configVisible = GetPreferences("Config", "Visible", configVisible); configConsole = GetPreferences("Config", "Console", configConsole); configMirror = GetPreferences("Config", "Mirror", configMirror); configMirrorPath = GetPreferences("Config", "MirrorPath", configMirrorPath); configAutoScroll = GetPreferences("Config", "AutoScroll", configAutoScroll); configMaxLines = GetPreferences("Config", "MaxLines", configMaxLines); configToggleKey = GetPreferences("Config", "Toggle", configToggleKey); configCollision = GetPreferences("Config", "Collision", configCollision); configToggleKey = configToggleKey.ToLower(); consoleMirror = new ConsoleMirror(configMirror ? configMirrorPath : "", callback); Application.RegisterLogCallback(new Application.LogCallback(LogCallbackHandler)); guiWindow.Visible = configVisible; }
public void Awake() { GameObject.DontDestroyOnLoad(this); Console.WriteLine("LogWindow"); configVisible = GetPreferences("Config", "Visible", configVisible); configConsole = GetPreferences("Config", "Console", configConsole); configMirror = GetPreferences("Config", "Mirror", configMirror); configMirrorPath = GetPreferences("Config", "MirrorPath", configMirrorPath); configAutoScroll = GetPreferences("Config", "AutoScroll", configAutoScroll); configMaxLines = GetPreferences("Config", "MaxLines", configMaxLines); configToggleKey = GetPreferences("Config", "Toggle", configToggleKey); configCollision = GetPreferences("Config", "Collision", configCollision); configToggleKey = configToggleKey.ToLower(); consoleMirror = new ConsoleMirror(configMirror ? configMirrorPath : "", callback); Application.RegisterLogCallback(new Application.LogCallback(LogCallbackHandler)); guiWindow.Visible = configVisible; }