Author Topic: UIPanel FindCameraForLayer  (Read 5648 times)

markofevil3

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 25
    • View Profile
UIPanel FindCameraForLayer
« on: August 02, 2014, 11:16:34 PM »
I'm using 2 cameras for displaying, 1 is Screen Camera and 1 is Popup Camera. When i add ScreenPanel to Scene(as a child of Screen Camera), it always detects Popup Camera as it's camera. Is there anyway i can specify render camera for UIPanel? in UIPanel script, you are using UICamera.FindCameraForLayer to detect camera. both cameras im using use 1 layer because the have same UIRoot. Do i have to use 2 UIRoot for this situation?

markofevil3

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 25
    • View Profile
Re: UIPanel FindCameraForLayer
« Reply #1 on: August 03, 2014, 05:38:42 AM »
I found a way that still use 1 UIRoot. each camera will have different layer and change Camera's culling mask and event mask to their layer. is that the good idea?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIPanel FindCameraForLayer
« Reply #2 on: August 03, 2014, 10:01:20 AM »
Why do you need a popup camera at all? If you need some kind of a popup to cover your UI, then just add a new panel with a depth higher than other panels.

markofevil3

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 25
    • View Profile
Re: UIPanel FindCameraForLayer
« Reply #3 on: August 05, 2014, 06:20:59 AM »
because of the complexity of UI. for example a screen use draggable Camera, and a popup still need to cover the screen. so i have to separate popup and screen to different camera.