Exemplo n.º 1
0
        // doAction -- Execute an action that isn't hooked to an event. Level scripts take precedence over global scripts.
        public void doAction(string key, string action)
        {
            bool       tryGlobal = true;
            ScriptBase script    = null;

            if (_scripts.TryGetValue(key, out script))
            {
                tryGlobal = script.doAction(action);
                tryGlobal = key == "global" ? false : tryGlobal;    // prevent trying 'global' twice in a row
            }

            if (tryGlobal)
            {
                _scripts["global"].doAction(action);
            }
        }