Unity SDK Docs 1.5.0-beta.6
Loading...
Searching...
No Matches
GameBoardSettings.cs
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 */
16using System.Collections;
17using System.Collections.Generic;
18using System;
19using UnityEngine;
20
21namespace TiltFive
22{
23 [System.Serializable]
25 {
36
44 public GameObject physicalGameboardOrigin;
45
46#if UNITY_EDITOR
47
54 public GameboardType gameboardTypeOverride = GameboardType.GameboardType_None;
55
60 public Vector3 gameboardOrientationOverride = Vector3.zero;
61
65 public bool enableGameboardOrientationOverride = false;
66
67#endif //UNITY_EDITOR
68
76 public float gameBoardScale => currentGameBoard != null ? currentGameBoard.localScale : 1f;
77
81 public Vector3 gameBoardCenter => currentGameBoard != null ? currentGameBoard.position : Vector3.zero;
82
86 public Vector3 gameBoardRotation => currentGameBoard != null ? currentGameBoard.rotation.eulerAngles : Vector3.zero;
87
91 [Obsolete("Please use Gameboard.TryGetGameboardType() instead.", true)]
92 public GameboardType gameboardType => currentGameBoard != null ? currentGameBoard.GameboardType : GameboardType.GameboardType_None;
93
94 public bool copyPlayerOneGameboard = true;
95
96 internal GameBoardSettings Copy()
97 {
98 return (GameBoardSettings)MemberwiseClone();
99 }
100
101 internal void Validate()
102 {
103 if(currentGameBoard.gameObject.Equals(physicalGameboardOrigin))
104 {
105 Debug.LogWarning("Gameboard and Physical Gameboard cannot be the same GameObject.");
107 }
108 }
109 }
110}
Represents the game board.
Definition GameBoard.cs:29
Vector3 gameBoardRotation
The gameboard rotation or focal rotational offset.
Vector3 gameBoardCenter
The gameboard position or focal position offset.
GameboardType gameboardType
The gameboard configuration, such as LE, XE, or folded XE.
GameBoard currentGameBoard
The gameboard is the window into the game world, as well as the origin about which the glasses/wand a...
GameObject physicalGameboardOrigin
A GameObject whose pose is driven by the gameboard's orientation in physical space,...
float gameBoardScale
The gameboard's scale multiplies the perceived size of objects in the scene.
GameboardType
The type of Gameboard being tracked by the glasses.