К сожалению, нормальный рабочий процесс Unity MultiDisplay не поддерживается iOS, поэтому решение немного сложнее:
using UnityEngine;
using System.Collections;
public class MultiScreen : MonoBehaviour
{
// set the two cameras via the inspector
public Camera primaryCam;
public Camera secondaryCam;
void Start()
{
// render the primary camera to the main display
primaryCam.SetTargetBuffers(Display.main.colorBuffer, Display.main.depthBuffer);
secondaryCam.depth = primaryCam.depth - 1;
secondaryCam.enabled = false;
}
void Update()
{
// only render the second display if it is attached
if (Display.displays.Length > 1 && !secondaryCam.enabled)
{
// set the second display's resolution
Display.displays[1].SetRenderingResolution(Display.displays[1].systemWidth, Display.displays[1].systemHeight);
// render the secondary camera to the second display
secondaryCam.SetTargetBuffers(Display.displays[1].colorBuffer, Display.displays[1].depthBuffer);
}
// activate the second camera and render pipeline if a second display is connected
secondaryCam.enabled = Display.displays.Length > 1;
}
}
Кроме того, я должен был убедиться, что Auto Graphics API
был деактивирован в Project Settings > Player > Other Settings > Rendering
и что Metal
было удалено из следующего списка.Установка Company Name
, Product Name
и Bundle Identifier
также могла бы помочь.