예제 #1
0
        public static void LoadSnapshot(TeamUtility.IO.InputManager inputManager)
        {
            if (!CanLoadSnapshot())
            {
                return;
            }

            InputLoaderXML inputLoader = new InputLoaderXML(_snapshotFile);

            inputManager.Load(inputLoader.Load());
        }
예제 #2
0
 public static void Load(IInputLoader inputLoader)
 {
     if (inputLoader != null)
     {
         _instance.Load(inputLoader.Load());
         _instance.Initialize();
         _instance.RaiseLoadedEvent();
     }
     else
     {
         Debug.LogError("InputLoader is null. Cannot load input configurations.");
     }
 }
예제 #3
0
        private void ImportInputConfigurations()
        {
            string file = EditorUtility.OpenFilePanel("Import input profile", "", "xml");

            if (string.IsNullOrEmpty(file))
            {
                return;
            }

            bool replace = EditorUtility.DisplayDialog("Replace or Append", "Do you want to replace the current input configrations?", "Replace", "Append");

            if (replace)
            {
                InputLoaderXML inputLoader = new InputLoaderXML(file);
                _inputManager.Load(inputLoader.Load());
                _selectionPath.Clear();
            }
            else
            {
                InputLoaderXML inputLoader = new InputLoaderXML(file);
                var            parameters  = inputLoader.Load();
                if (parameters.inputConfigurations != null && parameters.inputConfigurations.Count > 0)
                {
                    foreach (var config in parameters.inputConfigurations)
                    {
                        _inputManager.inputConfigurations.Add(config);
                    }
                }
            }

            if (_searchString.Length > 0)
            {
                UpdateSearchResults();
            }
            Repaint();
        }