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(bool disableButtons, Color bkgColor) //窗口管理,未指定窗口,用于弹出本脚本以外的窗口,
    {
        if (windowed)
        {
            return;
        }
        windowed = true;

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