Search Unity

Load<Sprite>() problems

Discussion in 'Scripting' started by aTruji, Aug 21, 2018.

  1. aTruji

    aTruji

    Joined:
    Mar 1, 2018
    Posts:
    3
    Hi guys,

    I am making a script to Load sprites from folders and am having some problems when the sprite i want to load are named: ñ.png and ç.png.

    When i want to load them is like the sprites don't exist and i can load them, but just happend when the sprite name are like the mentioned above, when the words are part of another word, the sprite are loaded well. Also, if i make a LoadAll<Sprite>() from the folder where are the sprites, there are no problems with them.

    The way am loading the sprites is: Sprite imageLoad = Resources.Load<Sprite>(pic.folder+ pic.name);

    Can some one provide any solution to this problem? Thanks in advance.
     
  2. Doug_B

    Doug_B

    Joined:
    Jun 4, 2017
    Posts:
    1,596
    If you debug both
    pic.name
    and
    pic.folder+ pic.name
    do they both appear to be correct?
     
  3. aTruji

    aTruji

    Joined:
    Mar 1, 2018
    Posts:
    3
    Yeah, they both appear correct.

    The problem is when i load that sprites they tell me that are null.

    I share a photo where you can see.

     
  4. Doug_B

    Doug_B

    Joined:
    Jun 4, 2017
    Posts:
    1,596
    So, as a test, if you were to rename
    ñ.png
    to be
    _ñ_.png
    , does it load ok then?
     
  5. aTruji

    aTruji

    Joined:
    Mar 1, 2018
    Posts:
    3
    Yes, it loads properly, but i need just to be automaticaly without the "_" because with the sprites am making sentences and then i use a TTS to read them, or at least I need to understand why it does not load when ñ.png and ç.png are the name of the file.