Exemple #1
0
    /// <summary>
    /// 添加流光特效
    /// </summary>
    /// <param name="b"></param>
    public void SetEffect(bool b)
    {
        if (b)
        {
            m_effectRoot.SetActive(true);
            m_effectRoot.transform.localPosition = new Vector3(130, -26.5f - (m_nHeight - 56) * 0.5f, 0);
            m_effectRoot.transform.localScale    = new Vector3(1, m_nHeight / 56.0f, 1);

            //特效
            UIParticleWidget wight = m_effectRoot.GetComponent <UIParticleWidget>();
            if (null == wight)
            {
                wight       = m_effectRoot.AddComponent <UIParticleWidget>();
                wight.depth = 100;
            }

            if (wight != null)
            {
                wight.SetDimensions(1, 1);
                wight.ReleaseParticle();
                wight.AddParticle(50026);
            }
        }
        else
        {
            m_effectRoot.SetActive(false);
        }
    }
Exemple #2
0
    void SetHttpDownPoint()
    {
        if (KDownloadInstance.Instance().GetTakeReward() == false)
        {
            stShowMainPanelRedPoint st = new stShowMainPanelRedPoint()
            {
                modelID   = (int)WarningEnum.HttpDown,
                direction = (int)WarningDirection.None,
                bShowRed  = true,
            };
            Engine.Utility.EventEngine.Instance().DispatchEvent((int)Client.GameEventID.MAINPANEL_SHOWREDWARING, st);
        }
        else
        {
        }

        Transform gmTrans = m_trans_AnchorTopRight.Find("XiaZai");

        if (gmTrans)
        {
            //gmTrans.gameObject.SetActive(true);
            UIParticleWidget p = gmTrans.GetComponent <UIParticleWidget>();
            if (p == null)
            {
                p       = gmTrans.gameObject.AddComponent <UIParticleWidget>();
                p.depth = 20;
            }
            if (p != null)
            {
                p.SetDimensions(150, 50);
                p.ReleaseParticle();
                p.AddParticle(50040);
            }
        }
    }
    void AddParticle(bool add)
    {
        UIParticleWidget p = Particle.GetComponent <UIParticleWidget>();

        if (p == null)
        {
            p       = Particle.gameObject.AddComponent <UIParticleWidget>();
            p.depth = 100;
        }
        if (add)
        {
            if (p != null)
            {
                p.SetDimensions(1, 1);
                p.ReleaseParticle();
                p.AddParticle(50025);
            }
        }
        else
        {
            if (p != null)
            {
                p.ReleaseParticle();
            }
        }
    }
Exemple #4
0
    void ControlMainBtnParticle(Transform parent, bool bShow)
    {
        if (parent != null)
        {
            Transform effect = parent.Find("effect");
            if (effect)
            {
                UIParticleWidget wight = effect.GetComponent <UIParticleWidget>();

                if (wight == null)
                {
                    wight       = effect.gameObject.AddComponent <UIParticleWidget>();
                    wight.depth = 20;
                }
                if (wight != null)
                {
                    wight.SetDimensions(1, 1);
                    wight.ReleaseParticle();
                    if (bShow)
                    {
                        wight.AddParticle(50040);
                    }
                    m_initMainPanel = bShow;
                }
            }
        }
    }
Exemple #5
0
 public void AddEffectInSkillPanel()
 {
     if (particle != null)
     {
         if (particle != null)
         {
             particle.SetDimensions(1, 1);
             particle.ReleaseParticle();
             particle.AddParticle(50023);
         }
     }
 }
Exemple #6
0
    private void SetBottomBtnLable(QuestTraceInfo taskInfo)
    {
        TaskProcess process = taskInfo.GetTaskProcess();

        if (process == TaskProcess.TaskProcess_None)
        {
            m_label_btn_bottom_Label.text = "接取";
        }
        else if (process == TaskProcess.TaskProcess_Doing)
        {
            m_label_btn_bottom_Label.text = "放弃";
        }
        else if (process == TaskProcess.TaskProcess_CanDone)
        {
            //开启自动完成
            if (taskInfo.QuestTable.dwAutoCanDone)
            {
                TimerAxis.Instance().KillTimer(MISSIONCANDONE_TIMER, this);
                TimerAxis.Instance().SetTimer(MISSIONCANDONE_TIMER, 1000, this);

                missionCanDoneBtnCd = CONST_MissionCanDoneBtnCd;
                string btnDes = string.Format("完成({0})", missionCanDoneBtnCd);
                m_label_btn_bottom_Label.text = btnDes;
            }
            else
            {
                if (TimerAxis.Instance().IsExist(MISSIONCANDONE_TIMER, this))
                {
                    TimerAxis.Instance().KillTimer(MISSIONCANDONE_TIMER, this);
                }
                m_label_btn_bottom_Label.text = "完成";
            }
            UIParticleWidget p = m_btn_btn_bottom.GetComponent <UIParticleWidget>();
            if (p == null)
            {
                p       = m_btn_btn_bottom.gameObject.AddComponent <UIParticleWidget>();
                p.depth = 20;
            }
            if (p != null)
            {
                p.SetDimensions(260, 54);
                p.ReleaseParticle();
                p.AddRoundParticle();
            }
        }
    }
Exemple #7
0
 void AddParticle()
 {
     if (m_trans_Particle != null)
     {
         if (particle == null)
         {
             particle       = m_trans_Particle.gameObject.AddComponent <UIParticleWidget>();
             particle.depth = 20;
         }
         if (particle != null)
         {
             particle.ReleaseParticle();
             particle.SetDimensions(1, 1);
             particle.AddParticle(50049);
         }
     }
 }
Exemple #8
0
 /// <summary>
 /// 五行阵环绕特效
 /// </summary>
 public void PlayCopyTargetEffect()
 {
     if (m_trans_copyTargetEffectRoot != null)
     {
         UIParticleWidget p = m_trans_copyTargetEffectRoot.GetComponent <UIParticleWidget>();
         if (p == null)
         {
             p       = m_trans_copyTargetEffectRoot.gameObject.AddComponent <UIParticleWidget>();
             p.depth = 20;
         }
         if (p != null)
         {
             p.SetDimensions(260, 225);
             p.ReleaseParticle();
             p.AddRoundParticle();
         }
     }
 }
 public void RefreshSigne()
 {
     if (m_goSelect != null)
     {
         m_goSelect.SetActive(true);
         UIParticleWidget p = m_goSelect.GetComponent <UIParticleWidget>();
         if (p == null)
         {
             p       = m_goSelect.gameObject.AddComponent <UIParticleWidget>();
             p.depth = 20;
         }
         if (p != null)
         {
             p.SetDimensions(150, 50);
             p.ReleaseParticle();
             p.AddRoundParticle();
         }
     }
 }
Exemple #10
0
    void OnPlayBtnTeXiao(GameObject go, uint resourceID = 50009)
    {
        Transform root = go.transform.Find("Particle");

        if (root != null)
        {
            UIParticleWidget p = root.GetComponent <UIParticleWidget>();
            if (p == null)
            {
                p       = root.gameObject.AddComponent <UIParticleWidget>();
                p.depth = 100;
            }
            if (p != null)
            {
                p.SetDimensions(1, 1);
                p.ReleaseParticle();
                p.AddRoundParticle(resourceID);
            }
        }
    }
Exemple #11
0
 void PlayEffect(Transform trans, bool show)
 {
     if (trans != null)
     {
         UIParticleWidget p = trans.GetComponent <UIParticleWidget>();
         if (p == null)
         {
             p       = trans.gameObject.AddComponent <UIParticleWidget>();
             p.depth = 20;
         }
         if (p != null)
         {
             p.SetDimensions(1, 1);
             p.ReleaseParticle();
             if (show)
             {
                 p.AddParticle(50038);
             }
         }
     }
 }
Exemple #12
0
 void PlayEffect(bool show)
 {
     if (particle != null)
     {
         UIParticleWidget p = particle.GetComponent <UIParticleWidget>();
         if (p == null)
         {
             p       = particle.gameObject.AddComponent <UIParticleWidget>();
             p.depth = 20;
         }
         if (p != null)
         {
             p.SetDimensions(1, 1);
             p.ReleaseParticle();
             if (show)
             {
                 p.AddParticle(50036);
             }
         }
     }
 }
Exemple #13
0
    void AddEffect(bool show)
    {
        UIParticleWidget p = m_trans_Particle.GetComponent <UIParticleWidget>();

        if (p == null)
        {
            p       = m_trans_Particle.gameObject.AddComponent <UIParticleWidget>();
            p.depth = 20;
        }
        if (p != null)
        {
            if (show)
            {
                p.SetDimensions(80, 80);
                p.ReleaseParticle();
                p.AddParticle(50013);
            }
            else
            {
                p.ReleaseParticle();
            }
        }
    }
Exemple #14
0
    SysMsgPushBtn GetSysMsgPushBtn(int index)
    {
        SysMsgPushBtn msgBtn = null;

        Transform child = m_trans_BtnRoot.Find("Btn_" + (index + 1).ToString());

        if (child != null)
        {
            msgBtn = child.gameObject.AddComponent <SysMsgPushBtn>();
        }
        UIParticleWidget wight = msgBtn.GetComponent <UIParticleWidget>();

        if (null == wight)
        {
            wight       = msgBtn.gameObject.AddComponent <UIParticleWidget>();
            wight.depth = 0;
        }

        //只出现了一个特效  如果要改成全都加特效  就不要判断effect
        if (wight != null)
        {
            UIParticleWidget p = wight.GetComponent <UIParticleWidget>();
            if (p == null)
            {
                p       = wight.gameObject.AddComponent <UIParticleWidget>();
                p.depth = 0;
            }
            if (p != null)
            {
                p.SetDimensions(1, 1);
                p.ReleaseParticle();
                p.AddParticle(50043);
            }
        }
        return(msgBtn);
    }
    SysMsgPushBtn GetSysMsgPushBtn()
    {
        SysMsgPushBtn msgBtn = null;
        GameObject    go     = NGUITools.AddChild(m_trans_PushRoot.gameObject, m_goPrefab);

        if (go != null)
        {
            msgBtn = go.AddComponent <SysMsgPushBtn>();
        }
        UIParticleWidget wight = msgBtn.GetComponent <UIParticleWidget>();

        if (null == wight)
        {
            wight       = msgBtn.gameObject.AddComponent <UIParticleWidget>();
            wight.depth = 100;
        }

        //只出现了一个特效  如果要改成全都加特效  就不要判断effect
        if (wight != null)
        {
            UIParticleWidget p = wight.GetComponent <UIParticleWidget>();
            if (p == null)
            {
                p       = wight.gameObject.AddComponent <UIParticleWidget>();
                p.depth = 20;
            }
            if (p != null)
            {
                p.SetDimensions(1, 1);
                p.ReleaseParticle();
                p.AddParticle(50043);
            }
        }

        return(msgBtn);
    }
Exemple #16
0
    /// <summary>
    /// 已经领奖励  hadGotReward
    /// </summary>
    /// <param name="hadGotReward"></param>
    void RefreshBtnStatus()
    {
        //完成首充了
        bool afterFirstRechage = DataManager.Manager <Mall_HuangLingManager>().AlreadyFirstRecharge.Count > 0;
        bool hadGotReward      = DataManager.Manager <ActivityManager>().HadGotFirstRechargeReward;

        m_btn_btn_recharge.gameObject.SetActive(!afterFirstRechage);
        m_btn_btn_getReward.gameObject.SetActive(afterFirstRechage);
        if (afterFirstRechage)
        {
            UIParticleWidget p = m_btn_btn_getReward.GetComponent <UIParticleWidget>();
            if (p == null)
            {
                p       = m_btn_btn_getReward.gameObject.AddComponent <UIParticleWidget>();
                p.depth = 20;
            }

            if (hadGotReward)
            {
                if (p != null)
                {
                    p.ReleaseParticle();
                }
            }
            else
            {
                //播放特效
                if (p != null)
                {
                    p.SetDimensions(180, 54);
                    p.ReleaseParticle();
                    p.AddRoundParticle();
                }
            }
        }
    }
Exemple #17
0
 public void RefreshSigne()
 {
     if (m_goCheck != null)
     {
         bool addparticle = m_WelfareData.state == QuickLevState.QuickLevState_CanGet;
         m_goCheck.SetActive(m_WelfareData.state == QuickLevState.QuickLevState_HaveGet);
         m_goSelect.SetActive(addparticle);
         UIParticleWidget p = m_goSelect.GetComponent <UIParticleWidget>();
         if (p == null)
         {
             p       = m_goSelect.gameObject.AddComponent <UIParticleWidget>();
             p.depth = 20;
         }
         if (p != null)
         {
             p.SetDimensions(144, 120);
             p.ReleaseParticle();
             if (addparticle)
             {
                 p.AddRoundParticle();
             }
         }
     }
 }
Exemple #18
0
    void ShowUI()
    {
        if (m_Trailerdata == null)
        {
            return;
        }
        itemDic.Clear();
        m_label_title.text = m_Trailerdata.strTitle;
        m_label_desc.text  = m_Trailerdata.strDesc;

        m_sprite_icon.spriteName = m_Trailerdata.strIcon;
        m_sprite_icon.MakePixelPerfect();
        FunctionPushManager manager = DataManager.Manager <FunctionPushManager>();
        UIParticleWidget    p       = m_spriteEx_btnget.GetComponent <UIParticleWidget>();

        if (p == null)
        {
            p       = m_spriteEx_btnget.gameObject.AddComponent <UIParticleWidget>();
            p.depth = 20;
        }
        if (manager.CanOpen(m_Trailerdata))
        {
            m_label_conditiondesc.text  = m_Trailerdata.strCondidtionDesc;
            m_label_conditiondesc.color = new Color(9 / 255.0f, 127 / 255.0f, 29 / 255.0f);
            m_label_btnLabel.text       = "领取奖励";
            m_spriteEx_btnget.ChangeSprite(2);

            if (p != null)
            {
                p.SetDimensions(200, 54);
                p.ReleaseParticle();
                p.AddRoundParticle();
            }
        }
        else
        {
            if (p != null)
            {
                p.ReleaseParticle();
            }
            m_label_btnLabel.text = "前往升级";
            m_spriteEx_btnget.ChangeSprite(1);

            string[] strcondition = m_Trailerdata.strCondidtionDesc.Split(new string[] { "\\n" }, StringSplitOptions.RemoveEmptyEntries);

            if (strcondition.Length == 2)
            {
                int           level = MainPlayerHelper.GetPlayerLevel();
                StringBuilder msg   = new StringBuilder();
                if (level < m_Trailerdata.level)
                {
                    msg.Append(ColorManager.GetColorString(ColorType.JZRY_Txt_Red, string.Format("{0}(还差{1}级)\n", strcondition[0], (m_Trailerdata.level - level))));
                }
                else
                {
                    msg.Append(ColorManager.GetColorString(ColorType.JZRY_Green, string.Format("{0}", strcondition[0])));
                }

                if (DataManager.Manager <TaskDataManager>().CheckTaskFinished(m_Trailerdata.task))
                {
                    msg.Append(ColorManager.GetColorString(ColorType.JZRY_Green, (string.Format("\n{0}", strcondition[1]))));
                }
                else
                {
                    msg.Append(ColorManager.GetColorString(ColorType.JZRY_Txt_Red, string.Format("\n{0}", strcondition[1])));
                }
                m_label_conditiondesc.text = msg.ToString();
            }
            else
            {
                int level = MainPlayerHelper.GetPlayerLevel();
                if (level < m_Trailerdata.level)
                {
                    m_label_conditiondesc.text = ColorManager.GetColorString(ColorType.JZRY_Txt_Red, string.Format("{0}(还差{1}级)", strcondition[0], (m_Trailerdata.level - level)));
                }
                else
                {
                    m_label_conditiondesc.text = ColorManager.GetColorString(ColorType.JZRY_Green, string.Format("{0}", strcondition[0]));
                }
            }
        }

        int       index = 0;
        UIManager uiMan = DataManager.Manager <UIManager>();

        if (string.IsNullOrEmpty(m_Trailerdata.strJobItem) == false)
        {
            string[] strJobItem = m_Trailerdata.strJobItem.Split(';');
            int      job        = MainPlayerHelper.GetMainPlayerJob();
            if (strJobItem.Length >= job && job > 0)
            {
                string[] strItem = strJobItem[job - 1].Split('_');
                if (strItem.Length == 2)
                {
                    uint itemId  = uint.Parse(strItem[0]);
                    uint itemNum = uint.Parse(strItem[1]);
                    if (!itemDic.ContainsKey(itemId))
                    {
                        itemDic.Add(itemId, itemNum);
                    }
                }
            }
        }
        else if (string.IsNullOrEmpty(m_Trailerdata.strItem) == false)
        {
            string[] strItem = m_Trailerdata.strItem.Split('_');
            if (strItem.Length == 2)
            {
                uint itemId  = uint.Parse(strItem[0]);
                uint itemNum = uint.Parse(strItem[1]);
                if (!itemDic.ContainsKey(itemId))
                {
                    itemDic.Add(itemId, itemNum);
                }
            }
        }
        else if (string.IsNullOrEmpty(m_Trailerdata.strMoney) == false)
        {
            string[] strItems = m_Trailerdata.strMoney.Split(';');
            for (int i = 0; i < strItems.Length; i++)
            {
                string[] strItem = strItems[i].Split('_');
                if (strItem.Length == 2)
                {
                    uint itemId  = uint.Parse(strItem[0]);
                    uint itemNum = uint.Parse(strItem[1]);
                    if (!itemDic.ContainsKey(itemId))
                    {
                        CurrencyIconData data = CurrencyIconData.GetCurrencyIconByMoneyType((ClientMoneyType)itemId);
                        if (data != null)
                        {
                            uint id = data.itemID;
                            itemDic.Add(id, itemNum);
                        }
                    }
                }
            }
        }
        m_lst_UIItemRewardDatas.Clear();
        var item = itemDic.GetEnumerator();

        while (item.MoveNext())
        {
            m_lst_UIItemRewardDatas.Add(new UIItemRewardData()
            {
                itemID = item.Current.Key,
                num    = item.Current.Value,
            });
        }
        m_ctor_UIItemRewardCreator.CreateGrids(m_lst_UIItemRewardDatas.Count);
    }
Exemple #19
0
    void ShowUI()
    {
        if (m_Trailerdata == null)
        {
            return;
        }
        m_lst_UIItemRewardDatas.Clear();
        m_label_title.text = m_Trailerdata.strTitle;
        m_label_desc.text  = m_Trailerdata.strDesc;
        if (string.IsNullOrEmpty(m_Trailerdata.strJobItem) == false)
        {
            string[] strJobItem = m_Trailerdata.strJobItem.Split(';');
            int      job        = MainPlayerHelper.GetMainPlayerJob();
            if (strJobItem.Length >= job && job > 0)
            {
                string[] strItem = strJobItem[job - 1].Split('_');
                if (strItem.Length == 2)
                {
                    uint itemId  = uint.Parse(strItem[0]);
                    uint itemNum = uint.Parse(strItem[1]);

                    m_nItemID = itemId;
                    m_lst_UIItemRewardDatas.Add(new UIItemRewardData()
                    {
                        itemID = itemId,
                        num    = itemNum,
                    });
                }
            }
        }
        else if (string.IsNullOrEmpty(m_Trailerdata.strItem) == false)
        {
            string[] strItem = m_Trailerdata.strItem.Split('_');
            if (strItem.Length == 2)
            {
                uint itemId  = uint.Parse(strItem[0]);
                uint itemNum = uint.Parse(strItem[1]);

                m_nItemID = itemId;
                m_lst_UIItemRewardDatas.Add(new UIItemRewardData()
                {
                    itemID = itemId,
                    num    = itemNum,
                });
            }
        }
        m_ctor_UIItemRewardCreator.CreateGrids(m_lst_UIItemRewardDatas.Count);

        FunctionPushManager manager = DataManager.Manager <FunctionPushManager>();
        UIParticleWidget    p       = m_spriteEx_btnget.GetComponent <UIParticleWidget>();

        if (p == null)
        {
            p       = m_spriteEx_btnget.gameObject.AddComponent <UIParticleWidget>();
            p.depth = 20;
        }

        if (manager.CanOpen(m_Trailerdata))
        {
            m_label_conditionDesc.text = ColorManager.GetColorString(ColorType.JZRY_Green, (string.Format("{0}", m_Trailerdata.strCondidtionDesc)));
            m_label_btnLabel.text      = "领取奖励";
            m_spriteEx_btnget.ChangeSprite(2);


            if (p != null)
            {
                p.SetDimensions(200, 54);
                p.ReleaseParticle();
                p.AddRoundParticle();
            }
        }
        else
        {
            if (p != null)
            {
                p.ReleaseParticle();
            }


            m_label_btnLabel.text = "前往升级";
            m_spriteEx_btnget.ChangeSprite(1);

            string[] strcondition = m_Trailerdata.strCondidtionDesc.Split(new string[] { "\\n" }, StringSplitOptions.RemoveEmptyEntries);

            if (strcondition.Length == 2)
            {
                int           level = MainPlayerHelper.GetPlayerLevel();
                StringBuilder msg   = new StringBuilder();
                if (level < m_Trailerdata.level)
                {
                    msg.Append(ColorManager.GetColorString(ColorType.JZRY_Txt_Red, string.Format("{0}(还差{1}级)\n", strcondition[0], (m_Trailerdata.level - level))));
                }
                else
                {
                    msg.Append(ColorManager.GetColorString(ColorType.JZRY_Green, string.Format("{0}", strcondition[0])));
                }

                if (DataManager.Manager <TaskDataManager>().CheckTaskFinished(m_Trailerdata.task))
                {
                    msg.Append(ColorManager.GetColorString(ColorType.JZRY_Green, (string.Format("\n{0}", strcondition[1]))));
                }
                else
                {
                    msg.Append(ColorManager.GetColorString(ColorType.JZRY_Txt_Red, string.Format("\n{0}", strcondition[1])));
                }
                m_label_conditionDesc.text = msg.ToString();
            }
            else
            {
                int level = MainPlayerHelper.GetPlayerLevel();
                if (level < m_Trailerdata.level)
                {
                    m_label_conditionDesc.text = ColorManager.GetColorString(ColorType.JZRY_Txt_Red, string.Format("{0}(还差{1}级)", strcondition[0], (m_Trailerdata.level - level)));
                }
                else
                {
                    m_label_conditionDesc.text = ColorManager.GetColorString(ColorType.JZRY_Green, string.Format("{0}", strcondition[0]));
                }
            }
        }
    }
Exemple #20
0
    void ShowItemInfo(MainUsePanelData data)
    {
        /*
         * List<BaseItem> lstItems = DataManager.Manager<ItemManager>().GetItemByBaseId(itemBaseid);
         * if (lstItems.Count <= 0)
         * {
         *  m_nitemThisId = 0;
         *  m_nitemBaseId = 0;
         *  return;
         * }
         * m_nitemThisId = lstItems[0].QWThisID;
         * m_nitemBaseId = itemBaseid;
         */

        //npc
        if (data.type == 1)
        {
            m__icon.gameObject.SetActive(false);
            m_sprite_iconCollect.gameObject.SetActive(true);
            Client.IEntitySystem es = Client.ClientGlobal.Instance().GetEntitySystem();
            if (es == null)
            {
                return;
            }

            INPC npc = es.FindNPC(data.Id);
            if (npc == null)
            {
                return;
            }

            //this.name = npc.GetName();
            this.name = "采集";
            m_label_item_name.text = string.Format("{0}[ffd966]({1})[-]", this.name, CLOSE_TIME);
        }
        //item
        else if (data.type == 2)
        {
            m__icon.gameObject.SetActive(true);
            m_sprite_iconCollect.gameObject.SetActive(false);
            table.ItemDataBase itemdata = GameTableManager.Instance.GetTableItem <table.ItemDataBase>(data.Id);
            if (itemdata != null)
            {
                UIManager.GetTextureAsyn(itemdata.itemIcon, ref m_iconCASD, () =>
                {
                    if (null != m__icon)
                    {
                        m__icon.mainTexture = null;
                    }
                }, m__icon);

                //this.name = itemdata.itemName;
                this.name = "使用";
                m_label_item_name.text = string.Format("{0}[ffd966]({1})[-]", this.name, CLOSE_TIME);
            }
        }

        //特效
        UIParticleWidget wight = m_sprite_iconBg.GetComponent <UIParticleWidget>();

        if (null == wight)
        {
            wight       = m_sprite_iconBg.gameObject.AddComponent <UIParticleWidget>();
            wight.depth = 100;
        }

        if (wight != null)
        {
            UIParticleWidget p = wight.GetComponent <UIParticleWidget>();
            if (p == null)
            {
                p       = wight.gameObject.AddComponent <UIParticleWidget>();
                p.depth = 20;
            }
            if (p != null)
            {
                p.SetDimensions(1, 1);
                p.ReleaseParticle();
                p.AddParticle(50019);
            }
        }

        StartCoroutine(WaitToClose());
    }