Projector
A script interface for a projector component.
Read time 7 minutesLast updated 2 days ago
Definition
- Type: Class
- Namespace: UnityEngine
- Assembly: UnityEngine.CoreModule
- Inherits from: Behaviour
public sealed class Projector : Behaviour
Remarks
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.
There is no shortcut property in GameObject or Component to access the Projector, so you must use Component.GetComponent to do it:
using UnityEngine;public class Example : MonoBehaviour{ void Start() { // Get the projector Projector proj = GetComponent<Projector>(); // Use it proj.nearClipPlane = 0.5f; }}
Additional Resources: projector component.
Properties
Property | Description |
|---|---|
| aspectRatio | The aspect ratio of the projection. |
| farClipPlane | The far clipping plane distance. |
| fieldOfView | The field of view of the projection in degrees. |
| ignoreLayers | Which object layers are ignored by the projector. |
| material | The material that will be projected onto every object. |
| nearClipPlane | The near clipping plane distance. |
| orthographic | Is the projection orthographic (true) or perspective (false)? |
| orthographicSize | Projection's half-size when in orthographic mode. |
Inheritance
Operators
Operator | Description |
|---|---|
| operator == | Compares two object references to see if they refer to the same object. |
| bool | Determines whether the object exists. |
| operator != | Compares if two objects refer to a different object. |