コード例 #1
0
        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;
            }
        }
コード例 #2
0
ファイル: YogaConfig.cs プロジェクト: kolombet/react-unity
        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
            }
        }
コード例 #3
0
        private static void LoggerInternal(
            IntPtr unmanagedConfigPtr,
            IntPtr unmanagedNodePtr,
            YogaLogLevel level,
            string message)
        {
            var config = YGConfigHandle.GetManaged(unmanagedConfigPtr);

            if (config == null || config._logger == null)
            {
                // Default logger
                System.Diagnostics.Debug.WriteLine(message);
            }
            else
            {
                var node = YGNodeHandle.GetManaged(unmanagedNodePtr);
                config._logger(config, node, level, message);
            }

            if (level == YogaLogLevel.Error || level == YogaLogLevel.Fatal)
            {
                throw new InvalidOperationException(message);
            }
        }
コード例 #4
0
ファイル: Native.cs プロジェクト: zmjios/yoga
 public static extern bool YGConfigIsExperimentalFeatureEnabled(
     YGConfigHandle config,
     YogaExperimentalFeature feature);
コード例 #5
0
ファイル: Native.cs プロジェクト: zmjios/yoga
 public static extern void YGConfigSetExperimentalFeatureEnabled(
     YGConfigHandle config,
     YogaExperimentalFeature feature,
     bool enabled);
コード例 #6
0
ファイル: Native.cs プロジェクト: zmjios/yoga
 public static extern YGNodeHandle YGNodeNewWithConfig(YGConfigHandle config);
コード例 #7
0
ファイル: Native.cs プロジェクト: zymxxxs/yoga
 public static extern void YGConfigSetPointScaleFactor(
     YGConfigHandle config,
     float pixelsInPoint);
コード例 #8
0
ファイル: Native.cs プロジェクト: zymxxxs/yoga
 public static extern bool YGConfigGetUseWebDefaults(YGConfigHandle config);
コード例 #9
0
ファイル: Native.cs プロジェクト: zymxxxs/yoga
 public static extern void YGConfigSetUseWebDefaults(
     YGConfigHandle config,
     bool useWebDefaults);
コード例 #10
0
ファイル: Native.cs プロジェクト: zbwbb/yoga
 public static extern bool YGConfigGetUseLegacyStretchBehaviour(YGConfigHandle config);
コード例 #11
0
ファイル: Native.cs プロジェクト: zbwbb/yoga
 public static extern void YGConfigSetUseLegacyStretchBehaviour(
     YGConfigHandle config,
     bool useLegacyStretchBehavior);