Tilt Five™ Unity API
1.3.0
Loading...
Searching...
No Matches
TiltFiveSingletonHelper.cs
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2020-2022 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
using
System.Collections;
17
using
System.Collections.Generic;
18
using
UnityEngine;
19
20
namespace
TiltFive
21
{
22
public
interface
ISceneInfo
23
{
24
float
GetScaleToUWRLD_UGBD
();
25
Pose
GetGameboardPose
();
26
Camera
GetEyeCamera
();
27
uint
GetSupportedPlayerCount
();
28
bool
IsActiveAndEnabled
();
29
}
30
31
public
static
class
TiltFiveSingletonHelper
32
{
33
public
static
ISceneInfo
GetISceneInfo
()
34
{
35
TryGetISceneInfo
(out var singleplayerSingleton);
36
return
singleplayerSingleton;
37
}
38
39
public
static
bool
TryGetISceneInfo
(out
ISceneInfo
sceneInfo)
40
{
41
if
(
TiltFiveManager2
.IsInstantiated)
42
{
43
sceneInfo =
TiltFiveManager2
.
Instance
;
44
return
true
;
45
}
46
47
if
(
TiltFiveManager
.IsInstantiated)
48
{
49
sceneInfo =
TiltFiveManager
.
Instance
;
50
return
true
;
51
}
52
53
sceneInfo =
null
;
54
return
false
;
55
}
56
}
57
}
TiltFive.SingletonComponent.Instance
static T Instance
Definition:
Singleton.cs:49
TiltFive.TiltFiveManager2
The Tilt Five manager.
Definition:
TiltFiveManager2.cs:45
TiltFive.TiltFiveManager
The Tilt Five manager.
Definition:
TiltFiveManager.cs:46
TiltFive.TiltFiveSingletonHelper
Definition:
TiltFiveSingletonHelper.cs:32
TiltFive.TiltFiveSingletonHelper.GetISceneInfo
static ISceneInfo GetISceneInfo()
Definition:
TiltFiveSingletonHelper.cs:33
TiltFive.TiltFiveSingletonHelper.TryGetISceneInfo
static bool TryGetISceneInfo(out ISceneInfo sceneInfo)
Definition:
TiltFiveSingletonHelper.cs:39
TiltFive.ISceneInfo
Definition:
TiltFiveSingletonHelper.cs:23
TiltFive.ISceneInfo.GetEyeCamera
Camera GetEyeCamera()
TiltFive.ISceneInfo.GetSupportedPlayerCount
uint GetSupportedPlayerCount()
TiltFive.ISceneInfo.GetGameboardPose
Pose GetGameboardPose()
TiltFive.ISceneInfo.GetScaleToUWRLD_UGBD
float GetScaleToUWRLD_UGBD()
TiltFive.ISceneInfo.IsActiveAndEnabled
bool IsActiveAndEnabled()
TiltFive
Definition:
Log.cs:21
Runtime
Utility
TiltFiveSingletonHelper.cs
Generated by
1.9.6