Uicamera of Deep excavation NGUI Foundation (II.)

Source: Internet
Author: User
  • First, the role of the UI camera
  1. Uicamera need to be mounted on the camera to play a role
  2. Uicamera is only responsible for sending Ngui events to the objects that are visible in the camera attached to the script, such as I have customized the Ngui layer (added in the Inspector panel) and set the layer of all UI elements under UI root to a custom Ngui layer.
  3. Event delivery depends not only on the Layer object on which the camera is mounted, but also on the event mask,eventmask in the UI camera script, which determines which game object's layer can be used to receive events (one or more layers). You can manually select the hierarchy object, but make sure that you need to send the event's layer layers in both the eventmask in the Uicamera script and the culling mask of the unity camera that the script is mounted on, otherwise the event cannot be sent to the object in the target layer.
  4. Optimization: You can check the camera's culling mask and Uicamera script Eventmask to everything, which guarantees that there will be no error. However, this causes the event to be broadcast when the global game object needs to be broadcasted, resulting in reduced efficiency and performance consumption , it is better to choose a layer precisely to send events, such as when you are using a single camera for small map rendering.

  • (ii) Uicamera attribute Panel field parsing

Uicamera of Deep excavation NGUI Foundation (II.)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.