public static void execute(Form1 form, List <UserControl> userControls, List <DrawLine> drawedLines) { OpenFileDialog openFileDialog = new OpenFileDialog(); ILoad load; openFileDialog.Filter = FORMATS; string filePath; if (openFileDialog.ShowDialog() == DialogResult.OK) { filePath = openFileDialog.FileName; load = new LoadXml(); if (".xml".Equals(filePath.Substring(filePath.Length - 4))) { load = new LoadXml(); } else if (".json".Equals(filePath.Substring(filePath.Length - 5))) { load = new LoadJSON(); } else if (".bmp".Equals(filePath.Substring(filePath.Length - 4))) { load = new LoadBmp(); } else { throw new InvalidDataException(); } RecoverContext.recovery(form, load.execute(filePath)); } }
// Use this for initialization void Start() { GameStatus status = LoadJSON.LoadJsonFromFile(); var re = status.statusList; Debug.Log(re); }
void Awake() { PropertiesFromJson = GetComponent<LoadJSON>(); AudioSource[] sources; sources = GetComponents<AudioSource>(); audio2 = sources[2]; ExplosionSpheres = GameObject.Find("HitFX_Ice"); ExplosionSpheres.SetActive(false); }
//LOAD CHESTS FROM JSON void Start() { Path = System.IO.Path.Combine(Application.dataPath, "save1.sjon"); SaveSpawnPosition(); var myData = LoadJSON.LoadingJSON <GameData>(); foreach (var VARIABLE in myData.Items) { Instantiate(_gameObj, VARIABLE.spawnPoint, Quaternion.identity); //print("Position " + VARIABLE.spawnPoint); } }
public ICommand ResolveCommand(JObject joCommand) { ICommand result = null; var commandName = JSONUtil.GetCommandName(joCommand); if (commandName == null) { return(null); } if (commandName == "load-json") { result = new LoadJSON(); } else if (commandName == "save-json") { result = new SaveJSON(); } else if (commandName == "prompt") { result = new PromptCommand(); } else if (commandName == "run-script") { result = new RunScript(); } else if (commandName == "communicate") { result = new Communicate(); } else if (commandName == "say") { result = new Communicate(); } //else if (commandName == "run-rules") { return new RunRules(); } else if (commandName == "assert") { return(new Assert()); } else if (commandName == "store") { return(new Store()); } return(result); }
void Start() { lookAtTextall = GetComponent<LoadJSON>(); lookAtText = GetComponent<Earthquakes>(); }
private void Start() { path = Path.Combine(Application.dataPath, "Save.json"); _objectMovement.DownloadData(LoadJSON.LoadingJSON <DataPoint>()); }