public static void Initialize() { if (!_initialized) { Native.YGInteropSetLogger(_managedLogger); _initialized = true; } }
private YogaConfig(YGConfigHandle ygConfig) { _ygConfig = ygConfig; if (_ygConfig.IsInvalid) { throw new InvalidOperationException("Failed to allocate native memory"); } _ygConfig.SetContext(this); if (_ygConfig == YGConfigHandle.Default) { _managedLogger = LoggerInternal; Native.YGInteropSetLogger(_managedLogger); } }
private YogaConfig(YGConfigHandle ygConfig) { _ygConfig = ygConfig; if (_ygConfig.IsInvalid) { throw new InvalidOperationException("Failed to allocate native memory"); } _ygConfig.SetContext(this); if (_ygConfig == YGConfigHandle.Default) { _managedLogger = LoggerInternal; #if (!UNITY_WEBGL && !UNITY_ANDROID) || UNITY_EDITOR Native.YGInteropSetLogger(_managedLogger); #endif } }
public static void Initialize() { if (!_initialized) { _managedLogger = (level, message) => { if (Logger != null) { Logger(level, message); } if (level == YogaLogLevel.Error) { throw new InvalidOperationException(message); } }; Native.YGInteropSetLogger(_managedLogger); _initialized = true; } }