예제 #1
0
    void create(string parts, string reff)
    {
        var clone = UGuiUtil.FindAndClone(m_templates, reff, m_parent);

        if (clone != null)
        {
            clone.name  = parts;
            m_latest    = clone;
            m_latest_rt = m_latest.GetComponent <RectTransform>();
        }
        else
        {
            throw new SystemException("Unexpected! {E8337688-F0C2-4506-9DE0-2CD12C0698B9}");
        }
    }
예제 #2
0
    public void SetError(string msg)
    {
        if (m_canvas.transform.childCount == 0)
        {
            var panel = UGuiUtil.FindAndClone(m_template.transform, "Panel", m_canvas);
            panel.name = errorpanelname;
            UGuiUtil.SetPivot(panel, UIANCHORPOS.MC);
            UGuiUtil.SetAnchor(panel, UIANCHORPOS.MC);
            UGuiUtil.SetSize(panel, ScreenDef.reference_width, ScreenDef.reference_height_fix);
            UGuiUtil.SetPos(panel, 0, 0);
        }

        var clone = (GameObject)GameObject.Instantiate(m_errorDlgUI);

        clone.transform.SetParent(m_canvas.transform);

        UGuiUtil.SetPos(clone, 0, 0);
        UGuiUtil.SetText(clone, msg, "Text");

        //clone.transform.localPosition = VectorUtil.Affect_Z(clone.transform.localPosition,0);
    }