public static Logger GetLogger(Type type) { if (type == null) throw new ArgumentNullException("type"); Logger l; lock (cachedLoggers) { if (!cachedLoggers.TryGetValue(type, out l)) { l = new Logger(type); cachedLoggers[type] = l; } } return l; }
/// <summary> /// This method is called called when the script instance is /// being loaded. /// </summary> public void Awake() { _logger = Logger.GetLogger(this.GetType()); // Call the method to process requests at a regular interval. _nextUpdateTime = Time.unscaledTime; _nextUpdateTime += _updateInterval; }