Author Topic: Updating from old version, a couple of issues  (Read 4096 times)

DoctorWhy

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 35
    • View Profile
Updating from old version, a couple of issues
« on: April 02, 2014, 07:07:05 PM »
I am updating from a pretty old version (2.6 or something) to the newest one. I have ran into a bit of an issue. For some reason, a couple sprites appear to be off by a pixel or something. I have a 25x25 sprite. If I press "Snap", it changes it to 26x26 for whatever reason (maybe it has to do with odd numbers?).  On top of that, it looks like the sprite is not exactly in the sprite box (look at the big picture, though that could just be an editor thing). But now when I put a sprite right next to it, it looks like it has a gap (say it starts at 0, so the first sprite ends at x 25, if I put a sprite at x 26, there is a gap between them). It wasn't like this in the old version. Is this intentional behavior?

The small picture below shows what it looks like on the camera, while the big picture is zoomed in. I tried updating the atlas thinking it was a problem with the old atlas, but I am now getting this error every time I do anything with any atlas (still seems to update though), even making a new atlas. (Though this error isn't getting thrown in a new project).

  1. TargetParameterCountException: parameters do not match signature
  2. System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/monoAndRuntimeClassLibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:188)
  3. System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/monoAndRuntimeClassLibs/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
  4. UnityEditor.AttributeHelper.InvokeMemberIfAvailable (System.Object target, System.String methodName, System.Object[] args) (at C:/BuildAgent/work/d3d49558e4d408f4/Editor/Mono/AttributeHelper.cs:236)
  5. UnityEditor.AssetPostprocessingInternal.PreprocessTexture (System.String pathName) (at C:/BuildAgent/work/d3d49558e4d408f4/Editor/Mono/AssetPostprocessor.cs:232)
  6. UnityEditor.AssetDatabase:ImportAsset(String, ImportAssetOptions)
  7. NGUIEditorTools:MakeTextureAnAtlas(String, Boolean, Boolean) (at Assets/NGUI/Scripts/Editor/NGUIEditorTools.cs:492)
  8. NGUIEditorTools:ImportTexture(String, Boolean, Boolean, Boolean) (at Assets/NGUI/Scripts/Editor/NGUIEditorTools.cs:506)
  9. UIAtlasMaker:UpdateTexture(UIAtlas, List`1) (at Assets/NGUI/Scripts/Editor/UIAtlasMaker.cs:567)
  10. UIAtlasMaker:UpdateAtlas(UIAtlas, List`1) (at Assets/NGUI/Scripts/Editor/UIAtlasMaker.cs:673)
  11. UIAtlasMaker:UpdateAtlas(List`1, Boolean) (at Assets/NGUI/Scripts/Editor/UIAtlasMaker.cs:656)
  12. UIAtlasMaker:OnGUI() (at Assets/NGUI/Scripts/Editor/UIAtlasMaker.cs:1002)
  13. UnityEditor.DockArea:OnGUI()
« Last Edit: April 02, 2014, 07:39:09 PM by DoctorWhy »

DoctorWhy

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 35
    • View Profile
Re: Updating from old version, a couple of issues
« Reply #1 on: April 03, 2014, 11:19:06 AM »
So... is the problem that my sprite is an odd number of pixels? I don't understand why this is happening...

EDIT: Yup, changing the sprite to an even 26x26 instead of 25x25 fixed it. That is incredibly strange, especially since it never use to be that way. I am sure you have your reasons for doing it though.
« Last Edit: April 03, 2014, 12:03:11 PM by DoctorWhy »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Updating from old version, a couple of issues
« Reply #2 on: April 03, 2014, 09:23:27 PM »
Can't divide 25 by 2 without getting half-pixels. Can't center on a half-pixel without getting a blurry sprite.