Beispiel #1
0
        public void GetOsInfo()
        {
            var handler = new OsVersionChecker();
            var result  = handler.GetVersion();

            Assert.IsTrue(result.Contains("Windows"));
        }
Beispiel #2
0
    static void Init()
    {
        if (!inited)
        {
#if UNITY_STANDALONE_WIN || UNITY_METRO
            string path = UnityEngine.Application.dataPath + "/Plugins/";
#if UNITY_EDITOR
            path += "x86/";
#endif
            if (LoadLibrary(path + "msvcr100.dll") == IntPtr.Zero)
            {
                Text.Error("failed to load msvcr100");
            }
            IntPtr lib = LoadLibrary(path + "FileDialogs.dll");
            if (lib == IntPtr.Zero)
            {
                Text.Error("Failed to load FileDialogs");
                return;
            }

            IntPtr proc = GetProcAddress(lib, "OpenFileDialog");
            OpenFileDialog = (OpenFileDialogDelegate)Marshal.GetDelegateForFunctionPointer(proc, typeof(OpenFileDialogDelegate));

            proc           = GetProcAddress(lib, "SaveFileDialog");
            SaveFileDialog = (SaveFileDialogDelegate)Marshal.GetDelegateForFunctionPointer(proc, typeof(SaveFileDialogDelegate));
#elif UNITY_STANDALONE_OSX
            OsVersionChecker checker = new OsVersionChecker();
            if (checker.currentVersion == OsVersion.SnowLeopard)
            {
                OpenFileDialog = OSX_PreLion.OpenFileDialog;
                SaveFileDialog = OSX_PreLion.SaveFileDialog;
            }
            else
            {
                OpenFileDialog = OSX_PostLion.OpenFileDialog;
                SaveFileDialog = OSX_PostLion.SaveFileDialog;
            }
#endif
            inited = true;
        }
    }