Exemple #1
0
 /// <summary>
 /// 自适应背景
 /// </summary>
 void AdaptBg()
 {
     UISprite[] sprs = m_TopAnchor.GetComponentsInChildren <UISprite>();
     for (int i = 0; i < sprs.Length; i++)
     {
         sprs[i].height = UIRootAdapter.GetLogicHeight() - 320;
     }
 }
    // Use this for initialization
    void OnEnable()
    {
        UIRoot root = gameObject.GetComponent <UIRoot>();

        if (null != root)
        {
            root.manualHeight = UIRootAdapter.GetLogicHeight();
        }
    }
Exemple #3
0
    void ResetFocusTrans()
    {
        int     logicW = UIRootAdapter.GetLogicWidth() / 2;
        int     logicH = UIRootAdapter.GetLogicHeight() / 2;
        Vector3 offset = m_NewPlayerGuideOffSet.transform.localPosition;

        focusTrans[0].localPosition = new Vector3(logicW + 1, logicH) - offset;
        focusTrans[1].localPosition = new Vector3(-logicW, logicH + 1) - offset;
        focusTrans[2].localPosition = new Vector3(-logicW - 1, -logicH) - offset;
        focusTrans[3].localPosition = new Vector3(logicW, -logicH - 1) - offset;
        for (int i = 0; i < 4; i++)
        {
            focusTwPos[i].from = focusTrans[i].localPosition;
        }
    }