Display 2 недоступен!
unityEngine.debug:logwarning (Object)
DisplaySwitcher: SwitchTodisplayTWO () (at assets /atsetsels /startbutton.cs: 24). /> unityEngine.eventsystems.eventsystem:update () (at ./library/packageCheache/com.unity.ugui@4f1c21fcc9bc/runtime/ugui/eventsystem/eventsystem.cs:544) Это вызвало ошибку: < /p>
Использование UnityEngine; < /p>
public class displayswitcher: monobehaviour
{< /p>
void start ()
{< /p>
Код: Выделить всё
for (int i = 1; i < Display.displays.Length; i++)
{
Display.displays[i].Activate();
}
}
public void SwitchToDisplayTwo()
{
if (Display.displays.Length > 1)
{
Camera.main.targetDisplay = 1;
Debug.Log("Switched to Display 2");
}
else
{
Debug.LogWarning("Display 2 is not available!");
}
}
Подробнее здесь: https://stackoverflow.com/questions/796 ... o-in-unity
Мобильная версия