/// <summary>
        /// Removes an event from a trigger region safely. If that region does not exist, you simply get a warning message instead of a crash.
        /// </summary>
        /// <returns>True if that region exists, false otherwise.</returns>
        public bool RemoveEvent(string regionName, TriggerReportEvent handler)
        {
            TriggerRegion tr;

            if (Regions.TryGetValue(regionName, out tr)) {
                tr.OnTrigger -= handler;
                return true;
            }
            Launch.Log("** [WARNING]: A trigger region with that name does not exist! (" + regionName + ")");
            return false;
        }
        /// <summary>
        /// Hooks an event to a trigger region safely. If that region does not exist, you simply get a warning message instead of a crash.
        /// </summary>
        /// <returns>If the region with that name exists, this returns that region. If it doesn't, this returns null.</returns>
        public TriggerRegion AddEvent(string regionName, TriggerReportEvent handler)
        {
            TriggerRegion tr;

            if (Regions.TryGetValue(regionName, out tr)) {
                tr.OnTrigger += handler;
                return tr;
            }
            Launch.Log("** [WARNING]: A trigger region with that name does not exist! (" + regionName + ")");
            return null;
        }
        public static TriggerRegion CreateBoxTriggerRegion(string name, TriggerReportEvent trh, Vector3 dimensions, Vector3 position, Quaternion orientation)
        {
            var csm = LKernel.GetG<CollisionShapeManager>();
            CollisionShape shape;

            if (!csm.TryGetShape(name, out shape)) {
                shape = new BoxShape(dimensions);
                csm.RegisterShape(name, shape);
            }

            var tr = new TriggerRegion(name, position, orientation, shape);
            tr.OnTrigger += trh;
            AddToDispose(tr, trh);
            return tr;
        }
        public static TriggerRegion CreateCapsuleTriggerRegion(
            string name, TriggerReportEvent trh, float radius, float height, Vector3 position, Quaternion orientation)
        {
            var csm = LKernel.GetG<CollisionShapeManager>();
            CollisionShape shape;

            if (!csm.TryGetShape(name, out shape)) {
                shape = new CapsuleShape(radius, height);
                csm.RegisterShape(name, shape);
            }

            var tr = new TriggerRegion(name, position, orientation, shape);
            tr.OnTrigger += trh;
            AddToDispose(tr, trh);
            return tr;
        }
 /// <summary>
 /// Shortcut method to add something to the dispose queue.
 /// </summary>
 static void AddToDispose(TriggerRegion region, TriggerReportEvent handler)
 {
     toDispose.Add(new Pair<TriggerRegion, TriggerReportEvent>(region, handler));
 }
        public static void HookFunctionToTriggerRegion(string nameOfRegion, TriggerReportEvent trh)
        {
            TriggerRegion tr = LKernel.Get<TriggerReporter>().AddEvent(nameOfRegion, trh);

            if (tr != null)
                AddToDispose(tr, trh);
        }