示例#1
0
 public static void SetCameraToStoryboard(bool bStoryboard)
 {
     EventDispatcher.Broadcast <bool>(ShaderEffectEvent.CAMERA_IN_STORY, bStoryboard);
     if (bStoryboard)
     {
         UINodesManager.SetUICanvas3D(CamerasMgr.Camera2Storyboard);
         CamerasMgr.SetCameraStoryboard(CamerasMgr.Camera2Storyboard);
         CamerasMgr.Camera2Storyboard.set_enabled(true);
         Utils.SetCameraCullingMask(CamerasMgr._Camera2Storyboard, 4);
         Utils.SetCameraCullingMask(CamerasMgr.CameraMain, 3);
     }
     else
     {
         UINodesManager.SetUICanvas3D(CamerasMgr.CameraMain);
         if (CamerasMgr._Camera2Storyboard != null)
         {
             CamerasMgr._Camera2Storyboard.set_enabled(false);
         }
         Utils.SetCameraCullingMask(CamerasMgr.CameraMain, 1);
     }
 }
示例#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();
    }