diff --git a/csharp/Facebook.Yoga/Native.cs b/csharp/Facebook.Yoga/Native.cs index e6ecaefe..59dd84c7 100644 --- a/csharp/Facebook.Yoga/Native.cs +++ b/csharp/Facebook.Yoga/Native.cs @@ -22,7 +22,9 @@ namespace Facebook.Yoga internal class YGNodeHandle : SafeHandle { +#if (UNITY_IOS && !UNITY_EDITOR) || __IOS__ private GCHandle _managed; +#endif private YGNodeHandle() : base(IntPtr.Zero, true) { @@ -89,14 +91,6 @@ namespace Facebook.Yoga [DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] public static extern int YGNodeGetInstanceCount(); -#if (UNITY_IOS && !UNITY_EDITOR) || __IOS__ - [DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - public static extern IntPtr YGNodeGetContext(IntPtr node); - - [DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - public static extern void YGNodeSetContext(IntPtr node, IntPtr managed); -#endif - [DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] public static extern void YGSetExperimentalFeatureEnabled( YogaExperimentalFeature feature, @@ -373,5 +367,17 @@ namespace Facebook.Yoga public static extern YogaDirection YGNodeLayoutGetDirection(YGNodeHandle node); #endregion + + #region IOS + +#if (UNITY_IOS && !UNITY_EDITOR) || __IOS__ + [DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr YGNodeGetContext(IntPtr node); + + [DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] + public static extern void YGNodeSetContext(IntPtr node, IntPtr managed); +#endif + + #endregion } }