Author Topic: feature request: atlas reference allowed to be null  (Read 2590 times)


  • Guest
feature request: atlas reference allowed to be null
« on: May 16, 2012, 07:41:38 AM »
ArenMook, if you set the reference atlas to None or null in script and you update the replacement atlas in Awake(), then set the replacement back to null OnDisable(), UIAtlasInspector changes the atlas from a reference type to a normal type.

Put simply, you cannot set your atlas to be null although this could be desireable. Why would you want this to be null? If you are testing the switching of Atlases in the editor from type None, to your switched atlas when you press play in the editor, it will stay the switched type after pressing stop, so OnDisable you set the atlas replacement back to null as a convenience but NGUI detects a null replacement and switches the atlas type from reference to normal.

If you desire this behaviour, comment out these lines in UIAtlasInspector.cs, but it will break the creation of new atlases:
  1. if (mReplacement == null) mType = AtlasType.Normal;
  1. if (mAtlas.replacement != null)
« Last Edit: May 16, 2012, 10:19:59 AM by loopyllama »


  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: feature request: atlas reference allowed to be null
« Reply #1 on: May 16, 2012, 02:57:45 PM »
This is intentional. It should be pretty easy for you to change the type yourself when you set the reference.