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

Question How to use Scripting Define Symbols in UnityLoader.js?

Discussion in 'Web' started by Matteo_Basso, Jul 27, 2023.

  1. Matteo_Basso

    Matteo_Basso

    Joined:
    Jun 25, 2022
    Posts:
    4
    Hi,
    I should fix the game data download script and to do that I would like to use the Scripting Define Symbols but it doesn't work.
    The error it gives me is:
    Code (JavaScript):
    1. Preprocessor error "ReferenceError: RELOAD_FILE_ON_FAIL is not defined" occured in file "UnityLoader/UnityLoader.js" at line 491 when evaluating expression "#if RELOAD_FILE_ON_FAIL"
    2. (Use `node --trace-uncaught ...` to show where the exception was thrown)
    3.  
    4. UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
    but the symbol is defined in Player Settings->Other Settings->Scripting Compilation->Scripting Define Symbols.


    I changed UnityLoader.js like this:
    Code (JavaScript):
    1. #if RELOAD_FILE_ON_FAIL
    2.   {{{ read("FetchWithProgressFix.js") }}}
    3. #else
    4.   {{{ read("FetchWithProgress.js") }}}
    5. #endif // RELOAD_FILE_ON_FAIL
    How can I fix it?
     
  2. Matteo_Basso

    Matteo_Basso

    Joined:
    Jun 25, 2022
    Posts:
    4
    Could someone help me please?
     
  3. Matteo_Basso

    Matteo_Basso

    Joined:
    Jun 25, 2022
    Posts:
    4
    Could someone help me please?
     
  4. Matteo_Basso

    Matteo_Basso

    Joined:
    Jun 25, 2022
    Posts:
    4
    Is there anyone who can help me?