Index: code/branches/core7/src/libraries/core/CorePrereqs.h
===================================================================
--- code/branches/core7/src/libraries/core/CorePrereqs.h	(revision 10578)
+++ code/branches/core7/src/libraries/core/CorePrereqs.h	(revision 10580)
@@ -212,4 +212,5 @@
     class Plugin;
     class PluginManager;
+    class PluginReference;
     struct ResourceInfo;
     template <ScopeID::Value>
Index: code/branches/core7/src/libraries/core/module/CMakeLists.txt
===================================================================
--- code/branches/core7/src/libraries/core/module/CMakeLists.txt	(revision 10578)
+++ code/branches/core7/src/libraries/core/module/CMakeLists.txt	(revision 10580)
@@ -5,4 +5,5 @@
   Plugin.cc
   PluginManager.cc
+  PluginReference.cc
   StaticallyInitializedInstance.cc
   StaticInitializationHandlerIncludes.cc
Index: code/branches/core7/src/libraries/core/module/PluginManager.cc
===================================================================
--- code/branches/core7/src/libraries/core/module/PluginManager.cc	(revision 10578)
+++ code/branches/core7/src/libraries/core/module/PluginManager.cc	(revision 10580)
@@ -33,11 +33,16 @@
 #include "SpecialConfig.h"
 #include "Plugin.h"
+#include "PluginReference.h"
 #include "core/ApplicationPaths.h"
 #include "core/command/ConsoleCommandIncludes.h"
+#include "core/object/Context.h"
 
 namespace orxonox
 {
-    SetConsoleCommand("PluginManager", "load", &PluginManager::loadPlugin);
-    SetConsoleCommand("PluginManager", "unload", &PluginManager::unloadPlugin);
+    static const std::string __CC_PluginManager_load_name  = "load";
+    static const std::string __CC_PluginManager_unload_name  = "unload";
+
+    SetConsoleCommand("PluginManager", __CC_PluginManager_load_name, &PluginManager::loadPlugin);
+    SetConsoleCommand("PluginManager", __CC_PluginManager_unload_name, &PluginManager::unloadPlugin);
 
     PluginManager* PluginManager::singletonPtr_s  = 0;
@@ -45,8 +50,15 @@
     PluginManager::PluginManager()
     {
+        ModifyConsoleCommand("PluginManager", __CC_PluginManager_load_name).setObject(this);
+        ModifyConsoleCommand("PluginManager", __CC_PluginManager_unload_name).setObject(this);
     }
 
     PluginManager::~PluginManager()
     {
+        ModifyConsoleCommand("PluginManager", __CC_PluginManager_load_name).setObject(NULL);
+        ModifyConsoleCommand("PluginManager", __CC_PluginManager_unload_name).setObject(NULL);
+
+        for (std::map<std::string, PluginReference*>::iterator it = this->references_.begin(); it != this->references_.end(); ++it)
+            delete it->second;
         for (std::map<std::string, Plugin*>::iterator it = this->plugins_.begin(); it != this->plugins_.end(); ++it)
             delete it->second;
@@ -74,7 +86,7 @@
     }
 
-    /*static*/ void PluginManager::loadPlugin(const std::string& name)
+    void PluginManager::referencePlugin(const std::string& name)
     {
-        Plugin* plugin = PluginManager::getInstance().plugins_[name];
+        Plugin* plugin = this->plugins_[name];
         if (plugin != NULL)
             plugin->load();
@@ -83,7 +95,7 @@
     }
 
-    /*static*/ void PluginManager::unloadPlugin(const std::string& name)
+    void PluginManager::dereferencePlugin(const std::string& name)
     {
-        Plugin* plugin = PluginManager::getInstance().plugins_[name];
+        Plugin* plugin = this->plugins_[name];
         if (plugin != NULL)
             plugin->unload();
@@ -91,3 +103,32 @@
             orxout(internal_warning) << "Cannot find plugin with name " << name << endl;
     }
+
+    /**
+     * @brief Console command to manually load a plugin. The plugin stays loaded until @ref unloadPlugin is called.
+     */
+    void PluginManager::loadPlugin(const std::string& name)
+    {
+        if (this->references_[name] == NULL)
+        {
+            this->references_[name] = new PluginReference(name);
+        }
+        else
+            orxout(internal_warning) << "Plugin " << name << " is already loaded" << endl;
+    }
+
+    /**
+     * @brief Console command to unload a plugin if it was previously loaded manually by calling @ref loadPlugin.
+     * Does not unload the plugin immediately if it is still used by another @ref PluginReference (e.g. by a @ref Level).
+     */
+    void PluginManager::unloadPlugin(const std::string& name)
+    {
+        PluginReference* reference = this->references_[name];
+        if (reference != NULL)
+        {
+            this->references_[name] = NULL;
+            delete reference;
+        }
+        else
+            orxout(internal_warning) << "Plugin " << name << " is already unloaded" << endl;
+    }
 }
Index: code/branches/core7/src/libraries/core/module/PluginManager.h
===================================================================
--- code/branches/core7/src/libraries/core/module/PluginManager.h	(revision 10578)
+++ code/branches/core7/src/libraries/core/module/PluginManager.h	(revision 10580)
@@ -48,9 +48,14 @@
             void findPlugins();
 
-            static void loadPlugin(const std::string& name);
-            static void unloadPlugin(const std::string& name);
+            void referencePlugin(const std::string& name);
+            void dereferencePlugin(const std::string& name);
+
+            // console commands
+            void loadPlugin(const std::string& name);
+            void unloadPlugin(const std::string& name);
 
         private:
             std::map<std::string, Plugin*> plugins_;
+            std::map<std::string, PluginReference*> references_; // references that were created by console command
 
             static PluginManager* singletonPtr_s;
Index: code/branches/core7/src/libraries/core/module/PluginReference.cc
===================================================================
--- code/branches/core7/src/libraries/core/module/PluginReference.cc	(revision 10580)
+++ code/branches/core7/src/libraries/core/module/PluginReference.cc	(revision 10580)
@@ -0,0 +1,46 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "PluginReference.h"
+
+#include "PluginManager.h"
+
+namespace orxonox
+{
+    PluginReference::PluginReference(const std::string& name) : name_(name)
+    {
+        // load plugin
+        PluginManager::getInstance().referencePlugin(this->name_);
+    }
+
+    PluginReference::~PluginReference()
+    {
+        // unload plugin
+        PluginManager::getInstance().dereferencePlugin(this->name_);
+    }
+}
Index: code/branches/core7/src/libraries/core/module/PluginReference.h
===================================================================
--- code/branches/core7/src/libraries/core/module/PluginReference.h	(revision 10580)
+++ code/branches/core7/src/libraries/core/module/PluginReference.h	(revision 10580)
@@ -0,0 +1,49 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _PluginReference_H__
+#define _PluginReference_H__
+
+#include "core/CorePrereqs.h"
+
+#include "core/object/Destroyable.h"
+
+namespace orxonox
+{
+    class _CoreExport PluginReference : public Destroyable
+    {
+        public:
+            PluginReference(const std::string& name);
+            ~PluginReference();
+
+        private:
+            std::string name_;
+    };
+}
+
+#endif /* _PluginReference_H__ */
