void Start() { GetComponent <Button>().onClick.AddListener(() => { string filePath = Application.persistentDataPath + '/' + mdlfilename; if (!File.Exists(filePath)) { IIS_Core.DownloadModel(mdlfilename, s => { if (!File.Exists(filePath)) { using (FileStream fs = File.Create(filePath)) { Byte[] info = new UTF8Encoding(true).GetBytes(s); fs.Write(info, 0, info.Length); } } var obj = OBJLoader.LoadOBJFile(filePath); SetupObject(obj); }); } else { var obj = OBJLoader.LoadOBJFile(filePath); SetupObject(obj); } }); markerSelectionWindow.SetActive(false); }
public void UpdateConfig(int index) { IIS_Core.UpdateCfg(mdlfilename, index, () => { marker.sprite = spriteCollection.MarkersImages[index]; this.index = index; Debug.Log("Successfully updated"); }); }
public void OnAuthRegisterClick() { IIS_Core.RegisterUser(username.text, passwrod.text, () => { AuthWindow.Hide(); AssetViewWindow.Show(); OnAuthSuccessCallback(username.text, passwrod.text); }, s => { loginStatusText.text = s; }); }
public void OnAuthLoginClick() { IIS_Core.LoginIn(username.text, passwrod.text, (v) => { AuthWindow.Hide(); AssetViewWindow.Show(); OnAuthSuccessCallback(username.text, passwrod.text); IIS_Core.DecodeAndApplySaveToView(v, this); }, s => { loginStatusText.text = s; }); }
public void OnAuthSuccessCallback(string username, string accesskey) { IIS_Core.SetUpProfile(username, accesskey); IIS_Core.FetchAllFiles(); }