コード例 #1
0
    // Destroy Vortex Studio application
    void OnDisable()
    {
        if (Ready)
        {
            // switch to editing
            VxDLL.VortexPause(true);
            VxDLL.VortexSetApplicationMode(1, true);

            // unload and destroy
            VxDLL.VortexDestroyApplication();

            Ready = false;
        }
    }
コード例 #2
0
    // Create Vortex Studio application
    void OnEnable()
    {
        string previous = System.IO.Directory.GetCurrentDirectory();

        try
        {
            // this will allow the library to load
            System.IO.Directory.SetCurrentDirectory(VxDLL.VortexRoot + "/" + "bin");

            // create the application with a given setup document, optional physical materials and terrain provider
            Ready = VxDLL.VortexCreateApplication(VxDLL.VortexRoot + "/" + "resources/config/VortexIntegration.vxc", "", "", "", 0);
        }
        catch
        {
            // does nothing
        }

        System.IO.Directory.SetCurrentDirectory(previous);

        // switch to simulating
        VxDLL.VortexSetApplicationMode(0, true);
        VxDLL.VortexPause(false);
    }