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.

TextAsset.bytes is broken in Unity 2019.2.1f1

Discussion in 'Scripting' started by IJM, Aug 19, 2019.

  1. IJM

    IJM

    Joined:
    Aug 31, 2010
    Posts:
    130
    I just upgraded from Unity 2018 to 2019, and TextAsset.bytes is not working correctly.
    I've tested it against System.IO.File.ReadAllBytes, and it returns a wrong number of bytes.

    In a case of test file it's 35153 bytes for System.IO.File.ReadAllBytes and Windows Explorer, but Unity TextAsset.bytes returns 40558 bytes from the same file.

    Any ideas why is this broken?
     
    Last edited: Aug 19, 2019
  2. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,110
    The docs says:

    So that's probably what's happening.