用户工具

站点工具


侧边栏



Unity3D中文文档

script:unityengine:classes:projector:projector

Projector 投影仪

class in UnityEngine/Inherits from: Behaviour

Description 描述

A script interface for a projector component.

投影仪组件的脚本接口。

The Projector can be used to project any material onto the scene - just like a real world projector. The properties exposed by this class are an exact match for the values in the Projector's inspector.

该投影仪可能被用于任何材质映射到场景上——就是看起来像是一个真实世界的投影仪。该类揭露了投影仪性能并且与投影仪面板上的值精准匹配。

It can be used to implement blob or projected shadows. You could also project an animated texture or a render texture that films another part of the scene. The projector will render all objects in its view frustum with the provided material.

它可以用于执行blob 或者投射阴影。你也可以投射一个动画纹理或者拍摄场景的另一部分的渲染纹理。该投影仪将会渲染在它的锥形视野内的所用对象并提供材质。

There is no shortcut property in GameObject or Component to access the Projector, so you must use GetComponent to do it:

该属性在游戏对象或者组件中没有快捷属性去使用投影仪,因此你必须使用GetComponent去完成它:

JavaScript:

function Start() {
	// Get the projector
	var proj : Projector = GetComponent (Projector);
	// Use it
	proj.nearClipPlane = 0.5;
}

C#:

using UnityEngine;
using System.Collections;
 
public class ExampleClass : MonoBehaviour {
    void Start() {
        Projector proj = GetComponent<Projector>();
        proj.nearClipPlane = 0.5F;
    }
}

Variables 变量

aspectRatioThe aspect ratio of the projection.
投射的长宽比。
farClipPlaneThe far clipping plane distance.
远裁剪面距离。
fieldOfViewThe field of view of the projection in degrees.
投影仪的视野范围单位度。
ignoreLayersWhich object layers are ignored by the projector.
被投影仪忽略的对象层。
materialThe material that will be projected onto every object.
该材质将被投影仪映射到每一个对象上。
nearClipPlaneThe near clipping plane distance.
近裁剪面距离。
orthographicIs the projection orthographic (true) or perspective (false)?
投射正交(true)或者透视(false)?
orthographicSizeProjection's half-size when in orthographic mode.
在正交模式下,是投影的一半大小。
script/unityengine/classes/projector/projector.txt · 最后更改: 2016/08/02 05:26 (外部编辑)