Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions POINT-VR-Chapter-1/Assets/AddressableAssetsData/Windows.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public class Scene1Manager : MonoBehaviour
private string objectiveThreeString;
private string objectiveFourString;

private Camera currentCamera = null;
private Camera mainCamera = null;
private GameObject player = null;
private UIManager uiManager = null;
private GameObject examplePath = null;
Expand Down Expand Up @@ -87,9 +87,9 @@ private void Start()

private void Update()
{
if (currentCamera != null)
if (mainCamera != null)
{
Shader.SetGlobalVector("Grid_Player_Position", currentCamera.transform.position);
Shader.SetGlobalVector("Grid_Player_Position", mainCamera.transform.position);
}
}

Expand Down Expand Up @@ -153,10 +153,10 @@ private IEnumerator Setup()
}
private IEnumerator WaitForPlayerSpawn()
{
yield return new WaitUntil(() => Camera.current != null);
yield return new WaitUntil(() => Camera.main != null);

currentCamera = Camera.current;
player = currentCamera.transform.parent.gameObject;
mainCamera = Camera.main;
player = mainCamera.transform.parent.gameObject;
uiManager = player.GetComponentInChildren<UIManager>(true);

yield break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ public class NarrationManager : MonoBehaviour
/// The GameObject with a TextMeshPro component to display the subtitles
/// </summary>
[SerializeField] private GameObject subtitleObject = null;
public GameObject SubtitleObject
{
get
{
return subtitleObject;
}
}

/// <summary>
/// Volume multiplier for narration volume
Expand Down
8 changes: 4 additions & 4 deletions POINT-VR-Chapter-1/Assets/POINT/Credits/EndCreditsManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ private class CreditsPosition
/// </summary>
private float endScrollY = 0.0f;

private Camera currentCamera = null;
private Camera mainCamera = null;
private GameObject player = null;

private IEnumerator Start()
Expand Down Expand Up @@ -160,10 +160,10 @@ private IEnumerator Start()

private IEnumerator WaitForPlayerSpawn()
{
yield return new WaitUntil(() => Camera.current != null);
yield return new WaitUntil(() => Camera.main != null);

currentCamera = Camera.current;
player = currentCamera.transform.parent.gameObject;
mainCamera = Camera.main;
player = mainCamera.transform.parent.gameObject;

yield break;
}
Expand Down
10 changes: 5 additions & 5 deletions POINT-VR-Chapter-1/Assets/POINT/Feature3/SortHolder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class SortHolder : MonoBehaviour
[SerializeField] private GameObject NextTaskButton;

private GameObject[] snapRings = null;
private Camera currentCamera = null;
private Camera mainCamera = null;
private GameObject player = null;

public void Start()
Expand All @@ -35,12 +35,12 @@ public void Start()

IEnumerator WaitForPlayerSpawn()
{
yield return new WaitUntil(() => Camera.current != null);
yield return new WaitUntil(() => Camera.main != null);

// Start menu initialization
currentCamera = Camera.current;
//this.GetComponent<Canvas>().worldCamera = currentCamera;
player = currentCamera.transform.parent.gameObject;
mainCamera = Camera.main;
//this.GetComponent<Canvas>().worldCamera = mainCamera;
player = mainCamera.transform.parent.gameObject;

yield break;
}
Expand Down
14 changes: 4 additions & 10 deletions POINT-VR-Chapter-1/Assets/POINT/Grid/PointGridGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

public class PointGridGenerator : MonoBehaviour
{
private Camera currentCamera = null;
public int radius;
public int density;
public float size;
Expand All @@ -19,12 +18,7 @@ public class PointGridGenerator : MonoBehaviour

IEnumerator WaitForPlayerSpawn()
{
yield return new WaitUntil(() => Camera.current != null);

// Start camera initialization
currentCamera = Camera.current;
//player = currentCamera.transform.parent.gameObject;

yield return new WaitUntil(() => Camera.main != null);
yield break;
}

Expand Down Expand Up @@ -52,7 +46,7 @@ public void CreateGrid()

obj.transform.parent = transform;
obj.transform.localScale = obj.transform.localScale * size;
//obj.transform.position = currentCamera.transform.position + new Vector3(1, 0, 0) * (d + 1) * density
//obj.transform.position = mainCamera.transform.position + new Vector3(1, 0, 0) * (d + 1) * density
// + new Vector3(0, 1, 0) * (i + 1) * density + new Vector3(0, 0, 1) * (j + 1) * density;

// First vector3 is starting position
Expand Down Expand Up @@ -84,7 +78,7 @@ public void DeleteGrid()

void Start()
{
StartCoroutine(WaitForPlayerSpawn()); // Fix camera spawning, currently currentCamera does not set
StartCoroutine(WaitForPlayerSpawn());
is_show = false;
objs = new List<GameObject>();

Expand Down Expand Up @@ -114,7 +108,7 @@ private void FixedUpdate()
int dd = (int)(i / (2 * radius * 2 * radius));
int ii = (int)((i - dd * (2 * radius * 2 * radius)) / (2 * radius));
int jj = (int)(i - dd * (2 * radius * 2 * radius) - ii * (2 * radius));
//org_pos = currentCamera.transform.position + new Vector3(1, 0, 0) * (dd + 1 - radius) * density
//org_pos = mainCamera.transform.position + new Vector3(1, 0, 0) * (dd + 1 - radius) * density
// + new Vector3(0, 1, 0) * (ii + 1 - radius) * density + new Vector3(0, 0, 1) * (jj + 1 - radius) * density;
org_pos = new Vector3(0, 0, 0) + new Vector3(1, 0, 0) * (dd + 1 - radius) * density + new Vector3(0, 1, 0) * (ii + 1 - radius) * density + new Vector3(0, 0, 1) * (jj + 1 - radius) * density;

Expand Down
Loading