/// <summary>
        /// Overridden function that gets called when the plugin is loaded. Registers all creator plugins
        /// </summary>
        /// <returns></returns>
        public override bool InitPluginModule()
        {
            EDITOR_PLUGIN_INFO.NativePluginNames = new string[] { "Havok" };
            HavokManaged.ManagedModule.InitManagedModule();

            StaticMeshShape.UsesCollisionGroups = true; // switch to displaying collision groups

            // register shape classes
            creators = new IShapeCreatorPlugin[]
            {
                new HavokConstraintShapeCreator(),
                new HavokConstraintChainShapeCreator(),
                new HavokResourceShapeCreator()
            };

            foreach (IShapeCreatorPlugin plugin in creators)
            {
                EditorManager.ShapeCreatorPlugins.Add(plugin);
            }

            // create and activate panel
            _panel = new HavokPhysicsPanel(EditorManager.ApplicationLayout.DockingArea);
            _panel.ShowDockable();

            // Register automated tests
            TestSuiteBuilder testBuilder = new TestSuiteBuilder();
            TestSuite        testSuite   = testBuilder.Build(typeof(EditorPlugin).Assembly.FullName);

            TestManager.AddTestSuite(testSuite);

            IProject.ProjectUnloaded += new EventHandler(IProject_ProjectUnloaded);

            return(true);
        }
        /// <summary>
        /// Overridden function that gets called when the plugin is loaded. Registers all creator plugins
        /// </summary>
        /// <returns></returns>
        public override bool DeInitPluginModule()
        {
            HavokManaged.ManagedModule.DeInitManagedModule();
            foreach (IShapeCreatorPlugin plugin in creators)
            {
                EditorManager.ShapeCreatorPlugins.Remove(plugin);
            }

            IProject.ProjectUnloaded -= new EventHandler(IProject_ProjectUnloaded);

            _panel.Close();
            _panel.Dispose();
            _panel = null;

            return(true);
        }
Exemple #3
0
        /// <summary>
        /// Overridden function that gets called when the plugin is loaded. Registers all creator plugins
        /// </summary>
        /// <returns></returns>
        public override bool DeInitPluginModule()
        {
            HavokManaged.ManagedModule.DeInitManagedModule();
            foreach (IShapeCreatorPlugin plugin in creators)
            {
                EditorManager.ShapeCreatorPlugins.Remove(plugin);
            }

            EditorManager.SceneChanged    -= new SceneChangedEventHandler(EditorManager_SceneChanged);
            IScene.EngineInstancesChanged -= new EngineInstancesChangedEventHandler(IScene_EngineInstancesChanged);

            _panel.Close();
            _panel.Dispose();
            _panel = null;

            return(true);
        }
        /// <summary>
        /// Overridden function that gets called when the plugin is loaded. Registers all creator plugins
        /// </summary>
        /// <returns></returns>
        public override bool DeInitPluginModule()
        {
            HavokManaged.ManagedModule.DeInitManagedModule();
              foreach (IShapeCreatorPlugin plugin in creators)
            EditorManager.ShapeCreatorPlugins.Remove( plugin );

              IProject.ProjectUnloaded -= new EventHandler(IProject_ProjectUnloaded);

              _panel.Close();
              _panel.Dispose();
              _panel = null;

              return true;
        }
        /// <summary>
        /// Overridden function that gets called when the plugin is loaded. Registers all creator plugins
        /// </summary>
        /// <returns></returns>
        public override bool InitPluginModule()
        {
            EDITOR_PLUGIN_INFO.NativePluginNames = new string[] { "Havok" };
              HavokManaged.ManagedModule.InitManagedModule();

              StaticMeshShape.UsesCollisionGroups = true; // switch to displaying collision groups

              // register shape classes
              creators = new IShapeCreatorPlugin[]
                 {
                   new HavokConstraintShapeCreator(),
                   new HavokConstraintChainShapeCreator(),
                   new HavokResourceShapeCreator()
                 };

              foreach (IShapeCreatorPlugin plugin in creators)
            EditorManager.ShapeCreatorPlugins.Add( plugin );

              // create and activate panel
              _panel = new HavokPhysicsPanel(EditorManager.ApplicationLayout.DockingArea);
              _panel.ShowDockable();

              // Register automated tests
              TestSuiteBuilder testBuilder = new TestSuiteBuilder();
              TestSuite testSuite = testBuilder.Build(typeof(EditorPlugin).Assembly.FullName);
              TestManager.AddTestSuite(testSuite);

              IProject.ProjectUnloaded += new EventHandler(IProject_ProjectUnloaded);

              return true;
        }
        /// <summary>
        /// Overridden function that gets called when the plugin is loaded. Registers all creator plugins
        /// </summary>
        /// <returns></returns>
        public override bool DeInitPluginModule()
        {
            HavokManaged.ManagedModule.DeInitManagedModule();
              foreach (IShapeCreatorPlugin plugin in creators)
            EditorManager.ShapeCreatorPlugins.Remove( plugin );

              EditorManager.SceneChanged -= new SceneChangedEventHandler(EditorManager_SceneChanged);
              IScene.EngineInstancesChanged -= new EngineInstancesChangedEventHandler(IScene_EngineInstancesChanged);

              _panel.Close();
              _panel.Dispose();
              _panel = null;

              return true;
        }
        /// <summary>
        /// Overridden function that gets called when the plugin is loaded. Registers all creator plugins
        /// </summary>
        /// <returns></returns>
        public override bool DeInitPluginModule()
        {
            HavokManaged.ManagedModule.DeInitManagedModule();
              foreach (IShapeCreatorPlugin plugin in creators)
            EditorManager.ShapeCreatorPlugins.Remove( plugin );

              _panel.Close();
              _panel.Dispose();
              _panel = null;

              return true;
        }