예제 #1
0
    /// <summary>
    /// Auto-upgrade.
    /// </summary>

    protected override void OnInit()
    {
        if (!mFillCenter)
        {
            mFillCenter = true;
            centerType  = AdvancedType.Invisible;
#if UNITY_EDITOR
            NGUITools.SetDirty(this);
#endif
        }

        try
        {
            //jwu NGUI - Fixing a RefAtlas AssetBundle issue.
            if (mAtlas != null && mAtlas.gameObject != null && !string.IsNullOrEmpty(mAtlas.name) && mAtlas.name.Contains("RefAtlas"))
            {
                mAtlas.FixUpAtlas(this);
            }
        }
        catch (Exception ex)
        {
            Debug.LogError("UISprite FixUpAtlas error: Message: " + ex.Message + ". StackTrace: " + ex.StackTrace);
        }

        base.OnInit();
    }