Exemplo n.º 1
0
 public void FakeHideAllUI(bool hide, int hide_nodes_2D = 7)
 {
     this.IsFakeHideAllUI = hide;
     UINodesManager.Show2DUI(!hide, hide_nodes_2D);
     UINodesManager.Show3DUI(!hide);
     EventDispatcher.Broadcast("UIManagerControl.FakeHideAllUI");
     EventDispatcher.Broadcast <bool>("ControlStick.ForbiddenStick", hide);
 }
Exemplo n.º 2
0
    public static void InitUICanvas()
    {
        if (UINodesManager.UIRoot == null)
        {
            return;
        }
        if (UINodesManager.m_NoEventsUIRoot != null)
        {
            return;
        }
        GameObject gameObject = AssetLoader.LoadAssetNow("Reserved/UICanvasNoEvents", typeof(Object)) as GameObject;

        if (gameObject == null)
        {
            Debug.LogError("prefabNoEvents初始化失败");
            return;
        }
        UINodesManager.m_NoEventsUIRoot = UGUITools.AddChild(UINodesManager.UIRoot.get_gameObject(), gameObject, false, "UICanvasNoEvents").get_transform();
        UINodesManager.m_NoEventsUIRoot.SetSiblingIndex(UINodesManager.NormalUIRoot.GetSiblingIndex());
        GameObject gameObject2 = AssetLoader.LoadAssetNow("Reserved/UICanvasEvents", typeof(Object)) as GameObject;

        if (gameObject2 == null)
        {
            Debug.LogError("prefabEvents初始化失败");
            return;
        }
        UINodesManager.m_MiddleUIRoot = UGUITools.AddChild(UINodesManager.UIRoot.get_gameObject(), gameObject2, false, "UICanvasMiddle").get_transform();
        UINodesManager.m_TopUIRoot    = UGUITools.AddChild(UINodesManager.UIRoot.get_gameObject(), gameObject2, false, "UICanvasTop").get_transform();
        UINodesManager.m_T2Root       = UGUITools.AddChild(UINodesManager.UIRoot.get_gameObject(), gameObject2, false, "UICanvasT2OfSpeical").get_transform();
        UINodesManager.m_T3Root       = UGUITools.AddChild(UINodesManager.UIRoot.get_gameObject(), gameObject2, false, "UICanvasT3OfSpecial").get_transform();
        UINodesManager.m_T4Root       = UGUITools.AddChild(UINodesManager.UIRoot.get_gameObject(), gameObject2, false, "UICanvasT4OfSpecial").get_transform();
        UINodesManager.SetUICanvas2Ds();
        UINodesManager.SetUICanvas3D(CamerasMgr.CameraMain);
        UINodesManager.Show3DUI(true);
        UINodesManager.SetUICamera();
    }