-
Notifications
You must be signed in to change notification settings - Fork 0
/
ScannerOffset.cs
41 lines (38 loc) · 1.25 KB
/
ScannerOffset.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using UnityEngine;
//! This class handles repositioning of the scanner in first person view, based on FOV.
public class ScannerOffset : MonoBehaviour
{
private StateManager stateManager;
public GameObject standardScanner;
public GameObject adjustedScanner;
public GameObject adjustedScanner2;
public void Start()
{
stateManager = FindObjectOfType<StateManager>();
}
//! Called once per frame by unity engine.
public void Update()
{
if (!stateManager.Busy())
{
if (Camera.main.fieldOfView > 66.6667 && Camera.main.fieldOfView < 73.3334)
{
standardScanner.SetActive(false);
adjustedScanner.SetActive(true);
adjustedScanner2.SetActive(false);
}
else if (Camera.main.fieldOfView > 73.3334)
{
standardScanner.SetActive(false);
adjustedScanner.SetActive(false);
adjustedScanner2.SetActive(true);
}
else if (Camera.main.fieldOfView < 66.6667)
{
standardScanner.SetActive(true);
adjustedScanner.SetActive(false);
adjustedScanner2.SetActive(false);
}
}
}
}