Exemplo n.º 1
0
    protected override void OnAwake()
    {
        base.OnAwake();
        m_lab_des = CacheTransform.Find("Content/Des").GetComponent <UIXmlRichText>();
        //m_lab_times = CacheTransform.Find("Content/Times").GetComponent<UILabel>();
        //m_reward = CacheTransform.Find("Content/RewardContent/Reward").GetComponent<UIGrid>();
        m_lab_reward  = CacheTransform.Find("Content/RewardContent/RewardTxt").GetComponent <UILabel>();
        m_obj_accept  = CacheTransform.Find("Content/Btns/BtnAccept").gameObject;
        m_typeLabel   = CacheTransform.Find("Content/IconContent/IconBg/Label").GetComponent <UILabel>();
        m_sprite_star = CacheTransform.Find("Content/star").GetComponent <UISprite>();

        m_lblCount = CacheTransform.Find("Content/Times").GetComponent <UILabel>();

        m_slider = CacheTransform.Find("Content/Times/Expslider").GetComponent <UISlider>();

        m_rewardMultiple = CacheTransform.Find("Content/IconContent/mask/Label").GetComponent <UILabel>();

        UIEventListener.Get(m_obj_accept).onClick = (obj) =>
        {
            //DataManager.Manager<ClanManger>().AcceptClanTask(questInfo.ID);
            AcceptClanTask();
        };
        m_obj_inProgress = CacheTransform.Find("Content/Btns/BtnDoing").gameObject;
        UIEventListener.Get(m_obj_inProgress).onClick = (obj) =>
        {
            //AutoMoveToTarget();
            DoClanTask();
        };
        m_obj_submit = CacheTransform.Find("Content/Btns/BtnSubmit").gameObject;
        UIEventListener.Get(m_obj_submit).onClick = (obj) =>
        {
            //DataManager.Manager<ClanManger>().FinishClanTask(questInfo.ID);
            FinishClanTask();
        };
    }
Exemplo n.º 2
0
    void ParseFromFile()
    {
        m_UIXmlRichText = m_widget_root.GetComponent <UIXmlRichText>();
        UnityEngine.Object prefab = UIManager.GetResGameObj("prefab/grid/richtextlabel.unity3d", "Assets/UI/prefab/Grid/RichTextLabel.prefab");
        m_UIXmlRichText.protoLabel = prefab as GameObject;
        m_UIXmlRichText.fontSize   = 24;
        string strFilePath = "notice.json";

        Engine.JsonNode root = Engine.RareJson.ParseJsonFile(strFilePath);
        if (root == null)
        {
            Engine.Utility.Log.Warning("华夏宝典解析{0}文件失败!", strFilePath);
            return;
        }
        Engine.JsonArray noticeArray = (Engine.JsonArray)root["notice"];
        for (int i = 0, imax = noticeArray.Count; i < imax; i++)
        {
            Engine.JsonObject noticeObj = (Engine.JsonObject)noticeArray[i];
            if (noticeObj == null)
            {
                continue;
            }
            QuestionNotice notice = new QuestionNotice();
            notice.index   = int.Parse(noticeObj["index"]);
            notice.title   = noticeObj["title"];
            notice.content = noticeObj["content"];
            m_lstNotice.Add(notice);
        }
    }
Exemplo n.º 3
0
    protected override void OnShow(object data)
    {
        base.OnShow(data);
        if (data is RunLightInfo)
        {
            RunLightInfo info = (RunLightInfo)data;
            if (info.pos == RunLightInfo.Pos.Bottom)
            {
                m_bottomQueue.Enqueue(info.msg);
                if (m_trans_Bottom.gameObject.activeSelf)
                {
                    return;
                }

                if (m_bottomXmlText == null)
                {
                    GameObject go = GameObject.Instantiate(m_lableObj) as GameObject;
                    go.transform.parent = m_trans_Bottom;
                    go.transform.transform.localScale = Vector3.one;

                    m_bottomXmlText = go.GetComponent <UIXmlRichText>();
                }
                m_trans_Bottom.gameObject.SetActive(true);
                AddBottomText();
            }
            else
            {
                m_topQueue.Enqueue(info);
                if (m_currTopRunLightInfo == null)
                {
                    AddTopTextFromQueue();
                }
            }
        }
    }
Exemplo n.º 4
0
    void InitNormal()
    {
        m_transNormal                       = transform.Find("normal");
        m_trans_normalInfo                  = m_transNormal.Find("normalinfo");
        m_normalRichTextContext             = m_transNormal.Find("normalinfo/xmlText").GetComponent <UIXmlRichText>();
        m_normalRichTextContext.UrlClicked += OnClickUrl;

        m_bgSprite = m_normalRichTextContext.transform.GetComponent <UISprite>();
        m_headIcon = m_transNormal.Find("icon_head").GetComponent <UITexture>();
        if (m_headIcon != null)
        {
            m_headIcon.pivot = UIWidget.Pivot.TopLeft;
        }
        UIEventListener.Get(m_headIcon.gameObject).onClick = OnHeadClick;

        m_lableChannel = m_transNormal.Find("normalinfo/channelName").GetComponent <UILabel>();

        if (m_lableChannel != null)
        {
            m_lableChannel.pivot = UIWidget.Pivot.TopLeft;
        }
        m_lableName = m_transNormal.Find("normalinfo/playerName").GetComponent <UILabel>();
        if (m_lableName != null)
        {
            m_lableName.pivot = UIWidget.Pivot.TopLeft;
        }
        m_spriteNameBg = m_transNormal.Find("normalinfo/channelNameBg").GetComponent <UISpriteEx>();
        if (m_spriteNameBg != null)
        {
            m_spriteNameBg.pivot = UIWidget.Pivot.TopLeft;
        }

        //voice
        m_goVoice                   = m_transNormal.Find("normalinfo/voice").gameObject;
        m_spriteVoiceBg             = m_transNormal.Find("normalinfo/voice/bg/voicebg").GetComponent <UISprite>();
        m_labelVoice                = m_transNormal.Find("normalinfo/voice/length").GetComponent <UILabel>();
        m_goVoiceTip                = m_transNormal.Find("normalinfo/voice/voicetip").gameObject;
        m_VoiceSprite               = m_transNormal.Find("normalinfo/voice/bg/Sprite").GetComponent <UISprite>();
        m_VoiceSprite.type          = UIBasicSprite.Type.Filled;
        m_VoiceSprite.fillDirection = UIBasicSprite.FillDirection.Horizontal;
        m_VoiceSprite.fillAmount    = 1;
        UIEventListener.Get(m_spriteVoiceBg.gameObject).onClick = OnClickVoice;

        m_trans_redPacket = m_transNormal.Find("redEnvelope");

        if (m_trans_redPacket != null)
        {
            Transform redText = m_trans_redPacket.Find("redText");
            if (redText == null)
            {
                return;
            }
            UIEventListener.Get(redText.gameObject).onClick = OnOpenRedPacket;
            Transform bless = redText.Find("blessmessage");
            if (bless != null)
            {
                m_label_blessmsg = bless.GetComponent <UILabel>();
            }
        }
    }
Exemplo n.º 5
0
 public override void Release(bool depthRelease = true)
 {
     base.Release(depthRelease);
     if (mSecondTabCreator != null)
     {
         mSecondTabCreator.Release(depthRelease);
     }
     if (bibleDic != null)
     {
         bibleDic.Clear();
     }
     if (m_dic != null)
     {
         m_dic.Clear();
     }
     if (mlstFirstTabIds != null)
     {
         mlstFirstTabIds.Clear();
     }
     if (temp != null)
     {
         temp.Clear();
     }
     if (m_UIXmlRichText != null)
     {
         m_UIXmlRichText = null;
     }
     if (m_lstNotice != null)
     {
         m_lstNotice.Clear();
     }
 }
Exemplo n.º 6
0
    protected override void OnLoading()
    {
        base.OnLoading();
        m_trans_ListContent.gameObject.SetActive(false);
        m_UIXmlRichText          = m_widget_NoticeMessage.GetComponent <UIXmlRichText>();
        m_UIXmlRichText.fontSize = 24;
        m_noticeLable            = m_scrollview_view.transform.Find("root/noticelabel").GetComponent <UILabel>();

        DataManager.Manager <LoginDataManager>().LoadFromUrl();
    }
Exemplo n.º 7
0
    protected override void OnLoading()
    {
        missionTitlePrefab = m_sprite_missionTile.gameObject;
        richText           = m_widget_taskDesc.GetComponent <UIXmlRichText>();

        //1级分类
        m_dicfTypes = new Dictionary <uint, UITypeGrid>();
        //2级分类
        m_dicsType = new Dictionary <uint, UISecondTypeGrid>();

        InitWidget();
    }
Exemplo n.º 8
0
    protected override void OnLoading()
    {
        CONST_TASK_CD = (float)GameTableManager.Instance.GetGlobalConfig <int>("TaskCountdown");

        AdjustUI();
        m_btn_btn.transform.localPosition = new Vector3(100000, 10000, 0);
        UIEventListener.Get(m_sprite_DialogBg.gameObject).onClick = OnClickScreen;
        uiXmlRichText = m_widget_RichText.GetComponent <UIXmlRichText>();
        UnityEngine.Object Prefab = UIManager.GetResGameObj("prefab/grid/richtextlabel.unity3d", "Assets/UI/prefab/Grid/RichTextLabel.prefab");
        uiXmlRichText.protoLabel = (GameObject)Prefab;

        UIEventListener.Get(m_widget_dragModel.gameObject).onDrag  = OnDragModel;
        UIEventListener.Get(m_widget_dragModel.gameObject).onClick = OnClickScreen;
    }
Exemplo n.º 9
0
    void InitSysUI()
    {
        m_transSys      = transform.Find("system");
        m_lableSysTitle = m_transSys.Find("title").GetComponent <UILabel>();
        m_spriteTitleBg = m_transSys.Find("titleBg").GetComponent <UISpriteEx>();
        if (m_spriteTitleBg != null)
        {
            m_spriteTitleBg.pivot = UIWidget.Pivot.TopLeft;
        }
        m_sysRichTextContext = m_transSys.Find("xmlText").GetComponent <UIXmlRichText>();
        m_spriteSysBg        = m_sysRichTextContext.transform.GetComponent <UIWidget>();

        m_sysRichTextContext.UrlClicked += OnClickUrl;
    }
Exemplo n.º 10
0
    void Update()
    {
        if (m_updateXmlText.Count <= 0)
        {
            m_trans_TOP.gameObject.SetActive(false);
            CheckToHide();
            return;
        }

        List <UIXmlRichText> todelete = new List <UIXmlRichText>();

        for (int i = 0; i < m_updateXmlText.Count; i++)
        {
            UIXmlRichText text = m_updateXmlText[i];
            Vector3       pos  = text.mtrans.localPosition;
            pos.x -= moveSpeed * Time.deltaTime;
            text.mtrans.localPosition = pos;
            if (-pos.x >= m_panelTop.width + text.m_layout.x + 5)
            {
                todelete.Add(text);
            }
        }

        if (todelete.Count > 0)
        {
            for (int i = 0; i < todelete.Count; i++)
            {
                m_updateXmlText.Remove(todelete[i]);
                GameObject.Destroy(todelete[i].gameObject);
                if (todelete[i].extObj != null)
                {
                    RunLightInfo info = (RunLightInfo)todelete[i].extObj;
                    if (--info.showTime > 0)
                    {
                        AddNewTopText(info);
                    }
                    else
                    {
                        m_currTopRunLightInfo = null;
                        AddTopTextFromQueue();
                    }
                }
            }
        }
        todelete.Clear();
    }
Exemplo n.º 11
0
    private void AddNewTopText(RunLightInfo info)
    {
        GameObject go = GameObject.Instantiate(m_lableObj) as GameObject;

        go.transform.parent = m_trans_root;
        go.transform.transform.localScale = Vector3.one;

        if (m_updateXmlText.Count > 0)
        {
            UIXmlRichText text = m_updateXmlText[m_updateXmlText.Count - 1];
            //localPosition.x  为负数 text.m_layout.x  m_trans_root的x点在右边300
            float width = text.mtrans.localPosition.x + text.m_layout.x;
            if (width <= 0)// 小于0 则全部在panel中了。
            {
                go.transform.transform.localPosition = Vector3.zero;
            }
            else
            {
                go.transform.transform.localPosition = new Vector3(text.mtrans.localPosition.x + text.m_layout.x + 15, 0, 0);
            }
        }
        else
        {
            go.transform.transform.localPosition = Vector3.zero;
        }

        UIXmlRichText xmltext = go.GetComponent <UIXmlRichText>();

        xmltext.extObj      = info;
        xmltext.UrlClicked += OnClickUrl;
        xmltext.AddXml(info.msg);
        xmltext.host.width = Mathf.CeilToInt(xmltext.m_layout.x);
        m_updateXmlText.Add(xmltext);

        if (m_trans_TOP.gameObject.activeSelf == false)
        {
            m_trans_TOP.gameObject.SetActive(true);
        }
    }
Exemplo n.º 12
0
 /// <summary>
 /// 移除超过聊天数目限制的信息
 /// </summary>
 /// <param name="addingCount"></param>
 private bool RemoveOverfloorChat(out UIXmlRichText richtext)
 {
     richtext = null;
     if (m_lstxmlText.Count >= MaxChatNum)
     {
         richtext = m_lstxmlText[0];//移除第一个
         //Transform title = richtext.transform.Find("titlebg");
         // if (title != null)
         // {
         //                 Transform spriteBg = title.Find("titlebg");
         //                 if (spriteBg != null)
         //                 {
         //                     spriteBg.parent = richtext.transform;
         //                 }
         //   title.parent = this.transform;
         //}
         m_lstxmlText.RemoveAt(0);
         richtext.Clear();
         // title.parent = richtext.transform;
         return(true);
     }
     return(false);
 }
Exemplo n.º 13
0
    private void AddBottomText()
    {
        if (m_bottomQueue.Count <= 0)
        {
            return;
        }

        string xml = m_bottomQueue.Dequeue();

        UIXmlRichText xmltext = m_bottomXmlText;

        xmltext.fontSize   = 18;
        xmltext.host.width = 1200;

        xmltext.UrlClicked += OnClickUrl;
        xmltext.AddXml(xml);
        if (xmltext.overline)
        {
            xmltext.host.width = 1200;
        }
        else
        {
            xmltext.host.width = Mathf.CeilToInt(xmltext.m_layout.x);
        }

        Vector3 pos = new Vector3(-xmltext.host.width * 0.5f, xmltext.host.height > xmltext.fontSize ? xmltext.host.height * 0.5f : 0, 0);

        xmltext.transform.transform.localPosition = pos;

        pos.y += 5;
        pos.x -= 5;
        m_sprite_buttombg.transform.localPosition = pos;
        m_sprite_buttombg.width  = xmltext.host.width + 10;
        m_sprite_buttombg.height = xmltext.host.height + 10;

        StartCoroutine(WaitForDestroy());
    }
Exemplo n.º 14
0
 protected override void OnLoading()
 {
     base.OnLoading();
     m_btn_btn.gameObject.SetActive(false);
     m_UIXmlRichText = m_widget_RichText.GetComponent <UIXmlRichText>();
 }