Example #1
0
    // 通过要引导的 index,显示引导
    public void ShowGuideWithIndex(int index, UnityAction e = null)
    {
        return;

        // 1 读表数据 得到表
        m_NewTemp = (NewbieguideTemplate)DataTemplate.GetInstance().m_NewbieguideTable.getTableData(index);
        // 2 判断是否应该引导

        if (m_NewTemp == null)
        {
            Debug.LogError("无效的指引 ID ");
            return;
        }

        if (UI_Guide.inst == null)
        {
            if (SceneManager.Inst.CurScene == SceneEntry.Home.ToString())
            {
                UI_HomeControler.Inst.AddUI(UI_Guide.UI_ResPath);
            }
            else if (SceneManager.Inst.CurScene == SceneEntry.Fight.ToString())
            {
                UI_FightControler.Inst.AddUI(UI_Guide.UI_ResPath);
            }
        }

        UI_Guide.inst.GuideWithInfo(m_NewTemp);

        if (e != null)
        {
            UI_Guide.inst.m_LeaveBtn.onClick.AddListener(e);
        }
        SendMessage(index);
    }
Example #2
0
    // 显示指引


    // 下一步引导
    public void ShowNextGuide()
    {
        return;

        // 小组引导结束
        if (m_NewTemp.getStop_type() == 1)
        {
            StopGuide();
            return;
        }

        if (m_NewTemp.getSkip_to() != -1)
        {
            m_NewTemp = (NewbieguideTemplate)DataTemplate.GetInstance().m_NewbieguideTable.getTableData(m_NewTemp.getSkip_to());
            if (UI_Guide.inst == null)
            {
                if (SceneManager.Inst.CurScene == SceneEntry.Home.ToString())
                {
                    UI_HomeControler.Inst.AddUI(UI_Guide.UI_ResPath);
                }
                else if (SceneManager.Inst.CurScene == SceneEntry.Fight.ToString())
                {
                    UI_FightControler.Inst.AddUI(UI_Guide.UI_ResPath);
                }
            }

            UI_Guide.inst.GuideWithInfo(m_NewTemp);
        }
        else
        {
            StopGuide();
        }
    }
Example #3
0
    /// <summary>
    /// 引导对话框
    /// 在配置表里面填写相应的屏幕坐标
    /// </summary>
    public void GuideWithInfo(NewbieguideTemplate temp)
    {
        m_NewTemp = temp;
        guideidList.Add(m_NewTemp.GetID());
        GetCurCanvas();

        // 女孩设置位置
        //string url = "UI/Sprites/";
        //m_Girl.sprite = UIResourceMgr.LoadSprite(url + m_NewTemp.getGuide());
        if (m_NewTemp.getNpc_x() != -1)
        {
            m_Girl.rectTransform.anchoredPosition = new Vector2(m_NewTemp.getNpc_x(), m_NewTemp.getNpc_y());
            m_Girl.gameObject.SetActive(true);
        }
        else
        {
            m_Girl.gameObject.SetActive(false);
        }

        // 对话框 位置
        m_TipsImage.rectTransform.anchoredPosition = new Vector2(m_NewTemp.getTalk_box_re_npc_x(), m_NewTemp.getTalk_box_re_npc_y());
        m_TipsImage.rectTransform.sizeDelta        = new Vector2(m_NewTemp.getTalk_box_w(), m_NewTemp.getTalk_box_h());

        // 背景遮罩
        //if (m_NewTemp.getBackground_shade() == -1)
        //{

        //}

        // 对话框提示内容
        string str = "";

        if (temp.GetID() == 100201 || temp.GetID() == 100501)
        {
            str = string.Format(GameUtils.getString(m_NewTemp.getGuide_word()), ObjectSelf.GetInstance().Name);
        }
        else
        {
            str = GameUtils.getString(m_NewTemp.getGuide_word());
        }
        m_TipsText.text = str;

        // 立即前往
        if (m_NewTemp.getGo_button() != -1)
        {
            m_LeaveBtn.gameObject.SetActive(true);
            m_LeaveBtn.onClick.RemoveAllListeners();

            // 设置回调 有点麻烦
            // TODO...
        }
        else
        {
            m_LeaveBtn.gameObject.SetActive(false);
        }
        // 跳过
        if (m_NewTemp.getSkip_button() != -1)
        {
            m_SkipBtn.gameObject.SetActive(true);
            //m_SkipBtn.onClick.RemoveAllListeners();
            m_SkipBtn.GetComponent <RectTransform>().anchoredPosition = new Vector2(m_NewTemp.getSkip_x(), m_NewTemp.getSkip_y());

            // 设置回调 有点麻烦
            // TODO...
        }
        else
        {
            m_SkipBtn.gameObject.SetActive(false);
        }

        // 点击继续
        if (m_NewTemp.getClick_continue() == -1)
        {
            m_Continue            = false;
            m_ContuineBtn.enabled = false;
            m_ContuineText.gameObject.SetActive(false);
        }
        else
        {
            m_Continue            = true;
            m_ContuineBtn.enabled = true;
            m_ContuineText.gameObject.SetActive(true);
        }


        // 高亮区
        // 这里如果出现间隙或者重复,那就麻烦了。
        ShowMask();

        // 小手
        ShowFinger();
    }