private void Log(string level, string message) { if (logger == null && useGlobalLogger) { logger = GameObject.Find("_USV_Global_Logger_").GetComponent <UdonLogger>(); } if (logger != null) { logger.Log(level, gameObject.name, message); } else { Debug.Log($"{level} [{gameObject.name}] {message}"); } }
private void Start() { text = GetComponent <TextMeshPro>(); levelCount = Mathf.Min(levels.Length, colors.Length); relayTargetCount = Mathf.Min(relayTargets.Length, relayLevels.Length); relayLevelIndices = new int[relayTargetCount]; if (relayToGlobalLogger) { globalLogger = (UdonLogger)GameObject.Find("_USV_Global_Logger_").GetComponent(typeof(UdonBehaviour)); } relayToGlobalLoggerLevelIndex = int.MaxValue; for (int i = 0; i < levelCount; i++) { var level = levels[i]; if (level == consoleLevel) { consoleLevelIndex = i; } if (level == textLevel) { textLevelIndex = i; } for (int j = 0; j < relayTargetCount; j++) { if (levels[j] == relayLevels[i]) { relayLevelIndices[j] = i; } } if (globalLogger != null && level == relayToGlobalLoggerLevel) { relayToGlobalLoggerLevelIndex = i; } } initialized = true; Log("Info", gameObject.name, "Initialized"); }