Author Topic: BUG: Reference Atlas Edit  (Read 2980 times)

gtoxast

  • Guest
BUG: Reference Atlas Edit
« on: October 15, 2012, 03:03:08 AM »
When editing reference atlas type, changes is being normally applied to the original one.
But, because referenced atlas is not marked as dirty, it wouldn't be saved.

I fixed it in UIAtlas.cs by inserting following if statement at the start of MarkAsDirty function.

  1. public void MarkAsDirty ()
  2. {
  3.         if(mReplacement != null)
  4.         {
  5.                 mReplacement.MarkAsDirty();
  6.         }
  7.  
  8.  
  9.  

UPD: It did not fix the situation as i first thought.
« Last Edit: October 15, 2012, 03:15:53 AM by gtoxast »

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: BUG: Reference Atlas Edit
« Reply #1 on: October 15, 2012, 04:24:23 AM »
Don't edit the reference atlas? :)

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: BUG: Reference Atlas Edit
« Reply #2 on: October 15, 2012, 06:07:09 AM »
I'll add this fix to the main repo, thanks.

gtoxast

  • Guest
Re: BUG: Reference Atlas Edit
« Reply #3 on: October 15, 2012, 06:42:57 AM »
To Nicki:
It did edit the referenced one, but wouldn't save it

ArenMook:
Np, but I hope u noticed my UPD. =)
So check my solution before including it pls.

Also i d like to let u know, that i improved your Clipping View list.
So items colliders would be scaled and repositioned on the edge of the view panel and disabled when they got out.
If u interested, i can post the code in other topic.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: BUG: Reference Atlas Edit
« Reply #4 on: October 15, 2012, 07:22:11 AM »
It's because you're missing:
  1. #if UNITY_EDITOR
  2.                 UnityEditor.EditorUtility.SetDirty(gameObject);
  3. #endif

gtoxast

  • Guest
Re: BUG: Reference Atlas Edit
« Reply #5 on: October 16, 2012, 09:33:25 AM »
Ok, here is the full fix:

UIAtlas ->
  1.         public void MarkAsDirty ()
  2.         {
  3.                 if(mReplacement != null)
  4.             {
  5.                 mReplacement.MarkAsDirty();
  6.             }
  7.                
  8. #if UNITY_EDITOR
  9.         UnityEditor.EditorUtility.SetDirty(gameObject);
  10. #endif
  11.  

And in UIAtlasMaker -> static void UpdateAtlas (UIAtlas atlas, List<SpriteEntry> sprites)
its better to change
  1.  EditorUtility.SetDirty(atlas.gameObject);
with 
  1. atlas.MarkAsDirty();



ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: BUG: Reference Atlas Edit
« Reply #6 on: October 16, 2012, 10:42:45 AM »
Yup, I've added these changes to the main repository, and I've made similar changes to the font class.