Пример #1
0
        /// <summary>
        /// Return native method delegates when running on Unity platform.
        /// Unity does not use standard NuGet packages and the native library is treated
        /// there as a "native plugin" which is (provided it has the right metadata)
        /// automatically made available to <c>[DllImport]</c> loading logic.
        /// WARNING: Unity support is experimental and work-in-progress. Don't expect it to work.
        /// </summary>
        private static NativeMethods LoadNativeMethodsUnity()
        {
            switch (PlatformApis.GetUnityRuntimePlatform())
            {
            case "IPhonePlayer":
                return(new NativeMethods(new NativeMethods.DllImportsFromStaticLib()));

            default:
                // most other platforms load unity plugins as a shared library
                return(new NativeMethods(new NativeMethods.DllImportsFromSharedLib()));
            }
        }
Пример #2
0
 static UserAgentStringProvider()
 {
     defaultInstance = new UserAgentStringProvider(VersionInfo.CurrentVersion, PlatformApis.FrameworkDescription, PlatformApis.ClrVersion, PlatformApis.GetGrpcCoreTargetFrameworkMoniker(), PlatformApis.ProcessArchitecture);
 }