Search Unity

How to pass information from building to play?

Discussion in 'Editor & General Support' started by ValBis, Oct 23, 2020.

  1. ValBis

    ValBis

    Joined:
    Jul 9, 2017
    Posts:
    50
    Hello, I am new in building exe with Unity so apologize if this is trivial.

    When I build a unity scene, I pass some command line arguments that determines some components of the scene, for example the number of cameras in the environment.

    During "play" time (when I run the exec) I would like to retrieve some of these parameters. For example, I can just do a .Find("Camera") for finding the number of objects that I have added. However sometime I may want to retrieve some more general data (e.g. int, strings) that I set up during build time.
    Is there a way to do so?

    The workaround I have found is to write what I need on an object name, and then parsing it out at runtime. This is pretty ugly, however. Any idea?
    Thanks