//////////////////////////////////////////////////////////////////////////
 private void GetVarScope(IWmeValue Variable, out Script Script, out ScriptScope Scope)
 {
     if (GlobalScope.Vars.ContainsKey(Variable))
     {
         Scope = GlobalScope;
         Script = null;
         return;
     }
     else
     {
         foreach (KeyValuePair<IntPtr, Script> kvp in Scripts)
         {
             ScriptScope ScrScope = kvp.Value.GetVarScope(Variable);
             if (ScrScope != null)
             {
                 Scope = ScrScope;
                 Script = kvp.Value;
                 return;
             }
         }
         Script = null;
         Scope = null;
     }
 }
 //////////////////////////////////////////////////////////////////////////
 public bool Refresh(ScriptScope GlobalScope)
 {
     this.GlobalScope = GlobalScope;
     return Refresh();
 }
 //////////////////////////////////////////////////////////////////////////
 public bool GameShutdown()
 {
     DebugWindow.ClearLog();
     //DebugWindow.AddLine("Shutdown");
     DebugWindow.Shutdown();
     Scripts.Clear();
     GlobalScope = new ScriptScope();
     return true;
 }