用户工具

站点工具


侧边栏

script:unityengine:classes:display:display

Display 显示

class in UnityEngine

Description 描述

Provides access to a display / screen for rendering operations.

提供显示器或者屏幕渲染操作的接口。

This feature is available for iPhone.

此功能可用于iPhone。

JavaScript:

void Start()
{
    // GUI is rendered with last camera.
    // As we want it to end up in the main screen, make sure main camera is the last one drawn.
    extCam.depth = camera.depth - 1;
 
    camera.SetTargetBuffers(Display.main.colorBuffer, Display.main.depthBuffer);
    extCam.enabled = false;
}
 
void Update()
{
    if(Display.displays.Length > 1 && !extCam.enabled)
    {
        Display.displays[1].SetRenderingResolution(256,256);
        extCam.SetTargetBuffers(Display.displays[1].colorBuffer, Display.displays[1].depthBuffer);
    }
    extCam.enabled = Display.displays.Length > 1;
}

C#:

void Start()
{
    // GUI is rendered with last camera.
    // As we want it to end up in the main screen, make sure main camera is the last one drawn.
    extCam.depth = camera.depth - 1;
 
    camera.SetTargetBuffers(Display.main.colorBuffer, Display.main.depthBuffer)
                                    
script/unityengine/classes/display/display.txt · 最后更改: 2016/08/02 05:35 (外部编辑)