-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPaintGunOffset.cs
31 lines (29 loc) · 948 Bytes
/
PaintGunOffset.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
using UnityEngine;
public class PaintGunOffset : MonoBehaviour
{
public GameObject standardPaintGun;
public GameObject adjustedPaintGun;
public GameObject adjustedPaintGun2;
//! Called once per frame by unity engine.
public void Update()
{
if (Camera.main.fieldOfView > 66.6667 && Camera.main.fieldOfView < 73.3334)
{
standardPaintGun.SetActive(false);
adjustedPaintGun.SetActive(true);
adjustedPaintGun2.SetActive(false);
}
else if (Camera.main.fieldOfView > 73.3334)
{
standardPaintGun.SetActive(false);
adjustedPaintGun.SetActive(false);
adjustedPaintGun2.SetActive(true);
}
else if (Camera.main.fieldOfView < 66.6667)
{
standardPaintGun.SetActive(true);
adjustedPaintGun.SetActive(false);
adjustedPaintGun2.SetActive(false);
}
}
}