Search Unity

How do I prevent/disguise/remove Unity from going Unresponsive when I import an .obj at runtime?

Discussion in 'Scripting' started by XenonSpher, Sep 28, 2016.

  1. XenonSpher

    XenonSpher

    Joined:
    Dec 11, 2015
    Posts:
    29
    First of all my app works after a short amount of unresponsive loading. it does import a .obj at runtime. but the reason probably of this momentary unresponsiveness is because of the script itself. it goes through a ton of scripts in just a short amount of time. the script I'm using this from here: https://www.assetstore.unity3d.com/en/#!/content/49547

    here's the app
    https://www.dropbox.com/s/a6evzf2hw0jzjy1/Backup RunTime OBJcomplete.rar?dl=0

    basically my app is an OBJ importer which you can also change the position, rotation, scale AND change the material color and material shader of the imported obj at runtime. and you can save all the data. but since runtime importation doesn't really save the obj as a prefab or save it in a resource folder at runtime or leave it at runtime or etc. .. so when you want to load you have to close the app, paste the url again and then press load..

    here's a demo on how to save.



    and then after saving I close the app and play it again or if you're using the editor unplay the editor and then play it again and paste the url again.. and then press load.

    demo of load



    so again the loading of the obj is my problem.. it goes unresponsive.

    by the way the url needs to be all forward slash.. so if the model i added is in here for example.

    C:\Users\rhylvin2016\Desktop\Build\BackupOBJImporter\Models\Lamborghini

    you just need to change all backslash to forward slash and add Avent.obj

    like so

    C:/Users/rhylvin2016/Desktop/Build/BackupOBJImporter/Models/Lamborghini/Avent.obj

    you'll also notice I wrote "Body" as Material Name. it is the name of the materials that are changed and are edited. so just try to use that one as well.

    P.S. I'm using XML to save and load.. the xml file can be found in Assets -> StreamingAssets -> XML -> item_data.xml
     
    Last edited: Oct 3, 2016
  2. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,406