Exemple #1
0
    //以下回调如果图片信息未完成或头像失败则不会显示最终结果...
    //需要判断如果是图片信息的话需要等图片加载完....
    //根据DangmuViewDataConveter的sprite成员判断图片是否都加载完...
    #region Sprite_Load_Callback
    public void HeadCallBack(Sprite headSprite, uint textIndex)
    {
        //
        DangmuViewDataConveter dangmuData = null;

        if (false == _textDicCache.TryGetValue(textIndex, out dangmuData))
        {
            Log.error(this, "DangmuViewDataConveter not found,index: " + textIndex + " size:" + _textDicCache.Count);
            return;
        }

        dangmuData._head = headSprite;

        //must clear text after displaying the bullet...
        if (dangmuData.IsText())
        {
            Displayer.AddBullet(dangmuData.GetColoredText(), dangmuData._content, CheckShowBox(), GetDirection(), headSprite, null);
            CycleText(textIndex);
        }
        else if (dangmuData.IsPicture() && dangmuData._body != null)             //如果body加载完则创建弹幕...
        {
            Displayer.AddBullet(dangmuData.GetColoredText(), dangmuData._content, CheckShowBox(), GetDirection(), dangmuData._head, dangmuData._body);
            CycleText(textIndex);
        }
        else if (dangmuData.IsUnknown())
        {
            CycleText(textIndex);
        }
    }
    //以下回调如果图片信息未完成或头像失败则不会显示最终结果...
    //需要判断如果是图片信息的话需要等图片加载完....
    //根据DangmuViewDataConveter的sprite成员判断图片是否都加载完...
    #region Sprite_Load_Callback
    public void HeadCallBack(Sprite headSprite, uint textIndex)
    {
        //
        DangmuViewDataConveter dangmuData = _textPool [(int)textIndex];

        if (null == dangmuData)
        {
            Debug.LogError("DangmuViewDataConveter not found,index: " + textIndex);
            return;
        }

        dangmuData._head = headSprite;
        if (dangmuData.IsText())
        {
            Displayer.AddBullet(dangmuData.GetColoredText(), dangmuData._content, CheckShowBox(), GetDirection(), headSprite, null);
        }
        else if (dangmuData.IsPicture() && dangmuData._head != null)             //如果body加载完则创建弹幕...
        {
            Displayer.AddBullet(dangmuData.GetColoredText(), dangmuData._content, CheckShowBox(), GetDirection(), dangmuData._head, dangmuData._body);
        }
    }
    //
    public void BodyCallBack(Sprite bodySprite, uint textIndex)
    {
        //
        DangmuViewDataConveter dangmuData = _textPool [(int)textIndex];

        if (null == dangmuData)
        {
            Debug.LogError("DangmuViewDataConveter not found,index: " + textIndex);
            return;
        }

        Debug.Log("BodyCallBack: bodySprite: " + bodySprite);
        Debug.Log("BodyCallBack: textIndex: " + textIndex);
        dangmuData._body = bodySprite;
        if (dangmuData.IsPicture() && dangmuData._head != null)
        {
            Displayer.AddBullet(dangmuData.GetColoredText(), dangmuData._content, CheckShowBox(), GetDirection(), dangmuData._head, dangmuData._body);
        }

        //NUll to od
    }
Exemple #4
0
    /// <summary>
    /// Bodies the call back.
    /// </summary>
    /// <param name="bodySprite">Body sprite.</param>
    /// <param name="textIndex">Text index.</param>
    public void BodyCallBack(Sprite bodySprite, uint textIndex)
    {
        //
        DangmuViewDataConveter dangmuData = null;

        if (false == _textDicCache.TryGetValue(textIndex, out dangmuData))
        {
            Log.warin(this, "DangmuViewDataConveter not found,index: " + textIndex + " size:" + _textDicCache.Count);
            return;
        }

        Log.debug(this, "BodyCallBack: bodySprite: " + bodySprite);
        Log.debug(this, "BodyCallBack: textIndex: " + textIndex);
        dangmuData._body = bodySprite;
        if (dangmuData.IsPicture() && dangmuData._head != null)
        {
            Displayer.AddBullet(dangmuData.GetColoredText(), dangmuData._content, GetDirection(), dangmuData._head, dangmuData._body);
            CycleText(textIndex);
        }
        //NUll to od
    }