private void Show(CSignalTips_InBatMsg data, CUIFormScript formScript)
    {
        if (data == null || formScript == null)
        {
            return;
        }
        if (this.signal_node != null)
        {
            this.signal_node.CustomSetActive(false);
        }
        if (this.inbattlemsg_node != null)
        {
            this.inbattlemsg_node.CustomSetActive(true);
        }
        ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey(data.heroID);

        if (dataByKey == null)
        {
            return;
        }
        if (this.leftIcon == null)
        {
            return;
        }
        this.SetHeroHeadIcon(this.leftIcon.gameObject.GetComponent <Image>(), formScript, dataByKey);
        Player hostPlayer = Singleton <GamePlayerCenter> .GetInstance().GetHostPlayer();

        Player playerByUid = Singleton <GamePlayerCenter> .GetInstance().GetPlayerByUid(data.playerID);

        if (hostPlayer == null || playerByUid == null)
        {
            return;
        }
        string text = (playerByUid == hostPlayer) ? CSignalTipShower.S_Bg_Green : CSignalTipShower.S_Bg_Blue;

        if (this.bg_icon == null)
        {
            return;
        }
        Image component = this.bg_icon.GetComponent <Image>();

        if (component != null && !string.IsNullOrEmpty(text))
        {
            component.SetSprite(text, formScript, true, false, false, false);
        }
        if (this.inbattlemsg_txt != null)
        {
            this.inbattlemsg_txt.set_text(data.content);
            this.inbattlemsg_txt.gameObject.CustomSetActive(true);
        }
        if (this.rightIcon != null)
        {
            this.rightIcon.CustomSetActive(false);
        }
        if (this.signal_icon != null)
        {
            this.signal_icon.CustomSetActive(false);
        }
    }
Ejemplo n.º 2
0
    private void Show(CSignalTips_InBatMsg data, CUIFormScript formScript)
    {
        if ((data != null) && (formScript != null))
        {
            if (this.signal_node != null)
            {
                this.signal_node.CustomSetActive(false);
            }
            if (this.inbattlemsg_node != null)
            {
                this.inbattlemsg_node.CustomSetActive(true);
            }
            ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey(data.heroID);
            if ((dataByKey != null) && (this.leftIcon != null))
            {
                this.SetHeroHeadIcon(this.leftIcon.gameObject.GetComponent <Image>(), formScript, dataByKey);
                Player hostPlayer = Singleton <GamePlayerCenter> .GetInstance().GetHostPlayer();

                Player playerByUid = Singleton <GamePlayerCenter> .GetInstance().GetPlayerByUid(data.playerID);

                if ((hostPlayer != null) && (playerByUid != null))
                {
                    string str = (playerByUid != hostPlayer) ? S_Bg_Blue : S_Bg_Green;
                    if (this.bg_icon != null)
                    {
                        Image component = this.bg_icon.GetComponent <Image>();
                        if ((component != null) && !string.IsNullOrEmpty(str))
                        {
                            component.SetSprite(str, formScript, true, false, false);
                        }
                        if (this.inbattlemsg_txt != null)
                        {
                            this.inbattlemsg_txt.text = data.content;
                            this.inbattlemsg_txt.gameObject.CustomSetActive(true);
                        }
                        if (this.rightIcon != null)
                        {
                            this.rightIcon.CustomSetActive(false);
                        }
                        if (this.signal_icon != null)
                        {
                            this.signal_icon.CustomSetActive(false);
                        }
                    }
                }
            }
        }
    }