/// <summary> /// Cache the provided instance and open log writer. /// </summary> /// <param name="simpleConsole"></param> private static void SetupInstance(SimpleConsole simpleConsole) { if (_consoleInstance != simpleConsole) { if (_consoleInstance != null) { Debug.LogWarning($"More than one SimpleConsole in the scene? {simpleConsole.name} overriding {_consoleInstance.name}"); _consoleInstance.CloseLogWriter(); } _consoleInstance = simpleConsole; if (_consoleInstance != null) { _consoleInstance.OpenLogWriter(); } } }
/// <summary> /// Cache the instance. /// </summary> private void Start() { Debug.Assert(_consoleInstance == null, "More than one Status component in the scene?"); _consoleInstance = this; }