Author Topic: UIRect failed to anchor self properly when multiple cameras are used.  (Read 2807 times)

beyonddoor

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 6
    • View Profile
Hi, all!
In my game, each UI frame is attached a camera for convenience , so here comes the problem, when an UIRect is enabled, ResetAnchors is called in its Update, in UIRect.cs.
  1. mMyCam = NGUITools.FindCameraForLayer(cachedGameObject.layer);

Actually, mMyCam is assigned to another frame's camera, thus the rect is totally wrong. Please help me to solve it.
ps, my currently used NGUI is 3.4.9.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIRect failed to anchor self properly when multiple cameras are used.
« Reply #1 on: November 10, 2014, 08:45:32 PM »
You need to make sure that only one camera is able to draw each layer. You have multiple cameras being able to draw the same layer, which is a bug on your part.