返回介绍

Projector 投影仪

发布于 2019-12-18 15:38:20 字数 3129 浏览 1218 评论 0 收藏 0

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.
在正交模式下,是投影的一半大小。

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文