Exemplo n.º 1
0
 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);
 }
Exemplo n.º 2
0
 public void UpdateConfig(int index)
 {
     IIS_Core.UpdateCfg(mdlfilename, index, () =>
     {
         marker.sprite = spriteCollection.MarkersImages[index];
         this.index    = index;
         Debug.Log("Successfully updated");
     });
 }
Exemplo n.º 3
0
 public void OnAuthRegisterClick()
 {
     IIS_Core.RegisterUser(username.text, passwrod.text,
                           () =>
     {
         AuthWindow.Hide();
         AssetViewWindow.Show();
         OnAuthSuccessCallback(username.text, passwrod.text);
     },
                           s => { loginStatusText.text = s; });
 }
Exemplo n.º 4
0
 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; });
 }
Exemplo n.º 5
0
 public void OnAuthSuccessCallback(string username, string accesskey)
 {
     IIS_Core.SetUpProfile(username, accesskey);
     IIS_Core.FetchAllFiles();
 }