Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Question Kindle-like app

Discussion in 'Scripting' started by thecoch, May 6, 2023.

  1. thecoch

    thecoch

    Joined:
    May 14, 2017
    Posts:
    17
    Hi,

    I'm wondering is there a solution to develop a kindle-like reader app? Including importing epub books, text selection, annotation, etc.

    Thanks for your help!
     
  2. orionsyndrome

    orionsyndrome

    Joined:
    May 4, 2014
    Posts:
    3,043
    I have a serious doubt someone would recreate epub parsing and rendering in Unity, mostly because the latest standards are heavily HTML5-oriented.

    Unity is far away from being an ideal text processor and you'd have to build a DOM parser and an internet browser, practically, supporting content structures and layouts and text flow and whatnot. Otherwise it's not an epub anymore.

    But I could be wrong, I don't know if there is perhaps a great demand for some reason or if it could be simplified. A real-time rendering engine should be an overkill for such an application.

    Now I wish books were done with animated illustrations and interactive storytelling. Oh wait.
     
    thecoch likes this.
  3. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    20,182
    Nothing I'm aware of that does precisely that. In line with @orionsyndrome's comment there is a browser asset available but it's going to be as heavy as a normal browser plus the weight of Unity and it's not a cheap either.

    https://assetstore.unity.com/publishers/40309
     
    thecoch likes this.
  4. thecoch

    thecoch

    Joined:
    May 14, 2017
    Posts:
    17
  5. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    20,182
    You can reduce it but you can't pause it, and there is a side effect to it. Input rate is tied to frame rate because it's just before Update() that input is polled by Unity. So a single frame per second would mean a single poll too. Plus there's no guarantee that you will get the refresh rate you want. Platforms can override it.

    https://docs.unity3d.com/ScriptReference/Application-targetFrameRate.html
     
    Last edited: May 7, 2023
  6. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,519
    The new InputSystem can be set to manual update mode, and you can disable Cameras and manually request renders, too. You could potentially also set up (platform specific) listeners for native device input so that you don't need to trigger full Input System updates until you know there's something to respond to.

    I've never tried any of that, because Unity simply doesn't strike me as a well suited tool for the type of app where you'd typically use such interaction models. By the time you've done all of that in any kind of polished manner I suspect that you may as well have spent the time learning something like Xamarin instead.
     
    Ryiah likes this.
  7. StarBornMoonBeam

    StarBornMoonBeam

    Joined:
    Mar 26, 2023
    Posts:
    209
    You could try use physics fixed update and go into project settings physics and set auto simulate off and then call simulate from a script. I think it ticks by the update may be incorrect. But I am sure it does.

    You can also have 60fps running constant but only call logic such as page turn when function is pressed. Dropping frames per second will give a bad user experience if dropping below 30.