Tilt Five™ Unity API  1.4.1
SpectatorSettings.cs
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2020-2023 Tilt Five, Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 using System.Collections;
18 using System.Collections.Generic;
19 using UnityEngine;
20 
21 namespace TiltFive
22 {
23  public enum GlassesMirrorMode
24  {
25  None,
26  LeftEye,
27  RightEye,
29  }
30 
31  [System.Serializable]
32  public class SpectatorSettings
33  {
37  public Camera spectatorCamera;
38 
50 
55 
64  public LayerMask cullingMask = ~0;
65 
74  public float fieldOfView = 60f;
75 
84  public float nearClipPlane = 0.3f;
93  public float farClipPlane = 1000f;
94 
103  public Rect rect = new Rect(0, 0, 1, 1);
104 
113  public RenderTexture targetTexture = null;
114 
115  internal void ResetSpectatorCamera()
116  {
117  spectatorCamera.cullingMask = cullingMask;
118  spectatorCamera.fieldOfView = fieldOfView;
119  spectatorCamera.nearClipPlane = nearClipPlane;
120  spectatorCamera.farClipPlane = farClipPlane;
121  spectatorCamera.rect = rect;
122  spectatorCamera.targetTexture = targetTexture;
123  }
124  }
125 }
PlayerIndex spectatedPlayer
The player that will have their perspective mirrored on screen.
RenderTexture targetTexture
The target texture used by the Spectator Camera.
float fieldOfView
The field of view to be used by the Spectator Camera.
Rect rect
The viewport rect used by the Spectator Camera.
GlassesMirrorMode glassesMirrorMode
The spectator camera will display content on screen depending on the mirroring mode....
Camera spectatorCamera
The camera used for rendering the onscreen preview
float nearClipPlane
The near clip plane to be used by the Spectator Camera.
LayerMask cullingMask
The culling mask to be used by the Spectator Camera.
float farClipPlane
The far clip plane to be used by the Spectator Camera.
Definition: Log.cs:21
PlayerIndex
The Player index (e.g. Player One, Player Two, etc)