Esempio n. 1
0
    /// <summary>
    /// 从自身向上查找,表情图片单独渲染,解决层级问题可以通过增加多个管理器解决(不是很好的解决方案)
    /// </summary>
    /// <returns></returns>
    private InlineSpriteManager GetSpriteManager()
    {
        Transform current = transform.parent;

        while (null != current)
        {
            InlineSpriteManager temp = current.GetComponentInChildren <InlineSpriteManager> ();
            if (temp != null)
            {
                return(temp);
            }

            current = current.parent;
        }
        return(null);
    }
Esempio n. 2
0
    private void Register()
    {
        if (mSpriteManager == null && canvas != null)
        {
            mSpriteManager = GetSpriteManager();

            if (mSpriteManager == null)
            {
                Debug.LogError("InlineSpriteAnimManager is miss");
            }
        }

        if (mSpriteManager != null)
        {
            mInlineSprite = mSpriteManager.GetComponent <inlineSprite_New>();
            mInlineSprite.SetAllDirty();

            ParseText();
            SetVerticesDirty();
            mSpriteManager.Register(this);
        }
    }
 public void OnEnable()
 {
     inlineManager = (InlineSpriteManager)target;
     spriteAsset   = inlineManager.m_spriteAsset;
 }