/// <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--;
}
else
cams[i] = uiCameras[src];
}
uiCameras = cams;
SetupPointers();
}
修复Unity3D EZGUI 1.06的UIManager 里面 AddCamera()方法
最新推荐文章于 2024-03-21 15:59:06 发布