Support => NGUI 3 Support => Topic started by: gtoxast on October 15, 2012, 03:03:08 AM
Title: BUG: Reference Atlas Edit
Post by: gtoxast 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.
publicvoid MarkAsDirty ()
{
if(mReplacement !=null)
{
mReplacement.MarkAsDirty();
}
UPD: It did not fix the situation as i first thought.
Title: Re: BUG: Reference Atlas Edit
Post by: Nicki on October 15, 2012, 04:24:23 AM
Don't edit the reference atlas? :)
Title: Re: BUG: Reference Atlas Edit
Post by: ArenMook on October 15, 2012, 06:07:09 AM
I'll add this fix to the main repo, thanks.
Title: Re: BUG: Reference Atlas Edit
Post by: gtoxast 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.
Title: Re: BUG: Reference Atlas Edit
Post by: ArenMook on October 15, 2012, 07:22:11 AM
It's because you're missing:
#if UNITY_EDITOR
UnityEditor.EditorUtility.SetDirty(gameObject);
#endif
Title: Re: BUG: Reference Atlas Edit
Post by: gtoxast on October 16, 2012, 09:33:25 AM
Ok, here is the full fix:
UIAtlas ->
publicvoid MarkAsDirty ()
{
if(mReplacement !=null)
{
mReplacement.MarkAsDirty();
}
#if UNITY_EDITOR
UnityEditor.EditorUtility.SetDirty(gameObject);
#endif
And in UIAtlasMaker -> static void UpdateAtlas (UIAtlas atlas, List<SpriteEntry> sprites) its better to change
EditorUtility.SetDirty(atlas.gameObject);
with
atlas.MarkAsDirty();
Title: Re: BUG: Reference Atlas Edit
Post by: ArenMook 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.