ControlScheme ReadControlScheme(XmlNode controlSchemeNode)
        {
            ControlScheme scheme = new ControlScheme(XMLTools.ReadAttribute(controlSchemeNode, "name", "Unnamed Control Scheme"));

            foreach (XmlNode inputActionNode in XMLTools.SelectSubNodesByName(controlSchemeNode, "Action"))
            {
                ReadInputAction(scheme, inputActionNode);
            }
            return(scheme);
        }
        void ReadInputAction(ControlScheme scheme, XmlNode inputActionNode)
        {
            string      name   = XMLTools.ReadAttribute(inputActionNode, "name", "Unnamed Action");
            InputAction action = scheme.CreateNewAction(name, XMLTools.ReadAttribute(inputActionNode, "displayName", name));

            foreach (XmlNode inputBindingNode in XMLTools.SelectSubNodesByName(inputActionNode, "Binding"))
            {
                ReadInputBinding(action, inputBindingNode);
            }
        }
 ControlScheme LoadControlScheme(XmlDocument doc, string schemeName)
 {
     foreach (XmlNode controlSchemeNode in XMLTools.SelectSubNodesByName(doc.DocumentElement, "ControlScheme"))
     {
         if (XMLTools.ReadAttribute(controlSchemeNode, "name") == schemeName)
         {
             return(ReadControlScheme(controlSchemeNode));
         }
     }
     return(null);
 }