private void CreateModel() { var handler = toWindowWhenClicked.GetComponent <ViewModelState>(); var widget = UIButton.current.GetComponent <ModelDataWidget>(); widget.modelData.modelPath = PersistanceManager.GetLocalServerModelPath(widget.modelData.name); handler.modelData = widget.modelData; StartCoroutine(CloudFile.DownloadFile(widget.modelData.modelFile, widget.modelData.modelUrl, () => { var parts = widget.modelData.modelFile.Split('.'); var path = Path.Combine(Utilities.GetPersistancePath(), "model." + parts[parts.Length - 1]); var task = (RMITask)Instantiate(controller.importTask); Utilities.LoadModelFileRMI(path, task, CreateModelCallback); })); }