Search Unity

Question Word document in unity?

Discussion in 'UI Toolkit' started by deadpool-Uy, May 29, 2023.

  1. deadpool-Uy

    deadpool-Uy

    Joined:
    Jan 23, 2023
    Posts:
    7
    Hi guys
    I have a question and I want to insert a Word document or a text document into my app. Do you use the Ui toolkit? Or do you just add the document by drag and drop?
    Thanks very much
     
  2. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,063
    This is possible, but you need to read out the file yourself. .txt should be relatively straightforward.
    Never touched a word file in Unity
     
  3. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,448
    Hi,

    unity doesn't support word documents, text you could copy paste in..
    but,
    do you want to make text editor or text viewer and on which platform(s)?
     
  4. deadpool-Uy

    deadpool-Uy

    Joined:
    Jan 23, 2023
    Posts:
    7
    @DevDunk what do you mean with read out the file?

    Thank you for your fast support
     
  5. deadpool-Uy

    deadpool-Uy

    Joined:
    Jan 23, 2023
    Posts:
    7
    @mgear i want to make a android and iOS app. The app is a cocking app with recipes and that’s why I need a text document. So i just need a text viewer.

    Thank you for your support
     
  6. spiney199

    spiney199

    Joined:
    Feb 11, 2021
    Posts:
    7,935
    Unless there's some game element to your app, I don't think Unity is a good choice here? There are probably more straightforward ways to make an app like that.
     
    rosco_y and DevDunk like this.
  7. deadpool-Uy

    deadpool-Uy

    Joined:
    Jan 23, 2023
    Posts:
    7
    @spiney199
    Yes you’re right but i have experience in unity and in unity you only need 4 clicks to build an iOS app and an android app
     
  8. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,063
    If you setup your environment properly this should be similar for other applications. Unity is not the best with loading and reading files, and will definitely have performance overhead as everything renders in a 3D world.
     
  9. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,448
    in any case, its definitely possible in unity, takes some effort to build nice ui elements though..

    most likely you would read the text files from server?
    or are the recipes be included in the app as text files?
    do the recipes need formatting, images, ingredient calculators and more?

    other option would be to have those recipes on your website,
    and in the mobile app, you just have webview to that (mobile) website..
     
    deadpool-Uy likes this.
  10. deadpool-Uy

    deadpool-Uy

    Joined:
    Jan 23, 2023
    Posts:
    7
    The recipes be included in the app as text files
     
  11. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,063
    Look up 'unity read txt file'
    An example is using StreamingAssets (note that for android this has to be done using WWW)

    Even better is to make a tool in unity which converts the text to strings and puts them in a class, object, scriptable object, wherever you need it, so you don't even have to ship the txt files themselves with the builds
     
    deadpool-Uy likes this.