Hello Guest

Author Topic: Transfer Sprite Collections from PC to MAC results in NullReference error  (Read 11482 times)

mterlecki

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: Transfer Sprite Collections from PC to MAC results in NullReference error
« Reply #15 on: February 08, 2015, 03:06:49 pm »
I have located the  problem and mostly fixed it. There were several files missing from Perforce - somehow they did not get added. However I still have a problem that after I do a build - some of my textures turn "Hot Pink" because they have lost the material reference. "Rebuild all sprites" fixes the issue.

But that does lead to another question. I have two platforms enabled (1x,2x), however when I look in sprite collection's data folder - there are 4 additional folders - I was expecting 2.

For example I have a sprite collection for my title screen name TitleBGSprites.

2DToolkit generated a folder by the name of "TitleBGSprites Data", inside this folder are 4 additional folders; "TitleBGSprites@1x 1 Data", "TitleBGSprites@1x Data", "TitleBGSprites@2x 1 Data" and "TitleBGSprites@2x Data"

Can you explain why there are 4 and what is in each one?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Transfer Sprite Collections from PC to MAC results in NullReference error
« Reply #16 on: February 08, 2015, 09:11:23 pm »
It looks like leftover files from a failed build.

Imagine a situation when the original files are there in TitleBGSprites@1x Data, at some point it didn't copy across properly and if a build was done at that point, it'd try to write into that directory again - the code then appends a "1" to the name to avoid name collisions, and creates the second folder there. In this case it sounds like you probably have a TitleBGSprites@1x 1.prefab in there too.

mterlecki

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: Transfer Sprite Collections from PC to MAC results in NullReference error
« Reply #17 on: February 08, 2015, 10:46:06 pm »
Yes I have a prefab file as well.
So the "TitleBGSprites@1x 1 Data" file should not be there. What is the safest way to delete these extra files?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Transfer Sprite Collections from PC to MAC results in NullReference error
« Reply #18 on: February 09, 2015, 10:30:58 am »
You need to find out which ones are used. the easiest way I guess is to select the sprite collection in the inspector, switch the inspector to debug mode and find the referenced data objects. You'll have to dig trough a couple levels of data there but you can follow the entire trail using the data objecr

mterlecki

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: Transfer Sprite Collections from PC to MAC results in NullReference error
« Reply #19 on: February 10, 2015, 04:04:08 pm »
I was able to use the GUID references in the sprite collection and compare them with the ones inside the sprite data ".meta" files and determine which sets of data were actually being used.
I deleted the others without issue. Everything seems to be working correctly now - thank you for you assistance.