修复Unity3D EZGUI 1.06的UIManager 里面 AddCamera()方法

来源:互联网 发布:美国最新经济数据 编辑:程序博客网 时间:2024/05/16 11:15
/// <summary>/// Adds the specified camera to the UI Cameras list at the specified index./// </summary>/// <param name="cam">The camera to be added.</param>/// <param name="mask">The layer mask for the camera.</param>/// <param name="depth">The depth into the scene the pointer should reach.</param>/// <param name="index">The index in the list where the camera should be added./// Note that cameras higher on the list (at a lower index value) process input before/// cameras later in the list.</param>public void AddCamera(Camera cam, LayerMask mask, float depth, int index){EZCameraSettings[] cams = new EZCameraSettings[uiCameras.Length + 1];// Keep the index in a valid range:index = Mathf.Clamp(index, 0, uiCameras.Length + 1);for (int i = 0, src = 0; i < cams.Length; i++, src++){if (i == index){cams[i] = new EZCameraSettings();cams[i].camera = cam;cams[i].mask = mask;cams[i].rayDepth = depth;                src--;}elsecams[i] = uiCameras[src];}uiCameras = cams;SetupPointers();}

原创粉丝点击