// Use this for initialization
 void Start()
 {
     Camera cam = GetComponent<Camera>();
     Rendering.RenderingUnit unit = new RenderingUnit(cam);
     RenderingMgr.Instance.AddUnitAtLast(unit);
 }
Exemplo n.º 2
0
 private void CreateUICam()
 {
     m_objUICam = new GameObject();
     m_objUICam.name = "UICamera";
     m_objUICam.layer = GameLayer.UI;
     m_objUICam.transform.SetParent(m_transRootCanvas, false);
     m_camUICam = m_objUICam.AddComponent<Camera>();
     m_camUICam.orthographic = true;
     m_compRootCanvas.renderMode = RenderMode.ScreenSpaceCamera;
     m_compRootCanvas.worldCamera = m_camUICam;
     m_objUICam.transform.localPosition = new Vector3(0.0f, 0.0f, -150.0f);
     m_camUICam.farClipPlane = 300.0f;
     m_camUICam.cullingMask = 1 << GameLayer.UI;
     m_camUICam.clearFlags = CameraClearFlags.Depth;
     RenderingUnit unit = new RenderingUnit("UINode", m_camUICam);
     RenderingMgr.Instance.AddCrucialUnitAtLast("UINode", unit);
 }