Search Unity

How to update Screen whilst start() script runnning

Discussion in 'Scripting' started by DennisHobbs, Jul 19, 2019.

  1. DennisHobbs

    DennisHobbs

    Joined:
    Jul 18, 2017
    Posts:
    4
    I have written a script that uses Streaming Assets to load data from a CSV data file and creates a model of a supermarket fixture with all its products at runtime from the data, it is creating lots of textured cubes, is there a way to update the scene / screen before the script completes.

    At the moment the script is assigned to the main camera

    At the moment the screen is blank until the assets are created then it displays the finished model fine but I would like to display it being built, for example update the view every second

    Hope I am making sconce this is my first major attempt with unity
     
  2. GroZZleR

    GroZZleR

    Joined:
    Feb 1, 2015
    Posts:
    3,201
    DennisHobbs likes this.
  3. DennisHobbs

    DennisHobbs

    Joined:
    Jul 18, 2017
    Posts:
    4
    Thank you for your suggestion I will study the tutorial and then work out how I can test for not End of File being processed and countdown time
     
  4. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    The display is not updated while any of your code is in the middle of running. Instead of doing this work in Start, you would spread the work across multiple frames. This can be implemented in Update or as already mentioned in a coroutine.