public YogaNode() { YogaLogger.Initialize(); _ygNode = Native.YGNodeNew(); if (_ygNode.IsInvalid) { throw new InvalidOperationException("Failed to allocate native memory"); } }
public YogaNode(YogaConfig config) { YogaLogger.Initialize(); _ygNode = Native.YGNodeNewWithConfig(config.Handle); if (_ygNode.IsInvalid) { throw new InvalidOperationException("Failed to allocate native memory"); } }
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; } }
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 extern void YGInteropSetLogger( [MarshalAs(UnmanagedType.FunctionPtr)] YogaLogger logger);