Exemple #1
0
 // Update is called once per frame
 void Update()
 {
     if (cc.is2dmode == true)
     {
         ts.DisableTouchControlView();
     }
     if (nowischangemode)
     {
         if (cc.is2dmode == false)
         {
             changemodeto2d();
             if ((cameratarget.transform.forward - cameratarget2d.transform.forward).sqrMagnitude < 0.01f)
             {
                 nowischangemode    = false;
                 cc.nowischangemode = false;
                 cc.is2dmode        = true;
                 ts.DisableTouchControlView();
             }
         }
         else if (cc.is2dmode == true)
         {
             changemodeto3d();
             if ((cameratarget.transform.forward - cameratarget3d.transform.forward).sqrMagnitude < 0.01f)
             {
                 Debug.Log("3d!");
                 nowischangemode    = false;
                 cc.nowischangemode = false;
                 cc.is2dmode        = false;
                 ts.EnableTouchControlView();
             }
         }
     }
 }
Exemple #2
0
    public void DisplayWindow(RectTransform rctTrans, bool disableButtons, Color bkgColor) //窗口管理,弹出一个窗口,所有弹出窗口相关的方法都要先调用此方法
    {
        if (windowed)
        {
            return;
        }
        windowed = true;

        StopAllCoroutines();
        if (disableButtons)
        {
            //禁用触摸
            tchScrn.DisableTouchMove();
            tchScrn.EnableTouchControlView();
            //禁用所有按钮
            Buttons = GameObject.FindGameObjectsWithTag("Button"); //获取暂时禁用的组件
            StartCoroutine(DisableButtons());
        }
        //transform.SetAsLastSibling();//调整层级

        StartCoroutine(EnablePanel(bkgColor));
        StartCoroutine(DisplayWnd(rctTrans));
    }