Commit 1f20bfe5 authored by Samantha Straka's avatar Samantha Straka
Browse files

Delay, Cubeposition better, visual angle condition in but needs to be adjusted

parent 34e1de36
......@@ -20,7 +20,7 @@ public class Cube : MonoBehaviour
private void Awake()
{
puzzleMaterial = front.GetComponent<MeshRenderer>().materials[0];
setOriginalPosition();
}
......@@ -145,6 +145,11 @@ public class Cube : MonoBehaviour
{
originalPosition = Oposition.transform;
}
public void setOriginalPosition()
{
originalPosition.transform.position = gameObject.transform.position;
originalPosition.transform.rotation = gameObject.transform.rotation;
}
//This is called at the start of the application, so that the cubes are lieing on the table
public void setToOriginalPosition()
......
......@@ -30,7 +30,7 @@ public class GameManager : MonoBehaviour
private int cubesInPuzzle = 0;
private bool allCubesSortedRight = false;
private int rightCubes = 0;
public GameObject smallAngleModerator;
int condition; //0 is no brand, 1 is poster brand, 2 is puzzle brand, 3 is audio brand
// Start is called before the first frame update
int numberOfcondition = 8; //the number of the condition. Goes up when a puzzle is solved
......@@ -41,38 +41,41 @@ public class GameManager : MonoBehaviour
private void Awake()
{
StartScript.vr = 87;
if (StartScript.vr == 0)
switch (StartScript.vr)
{
print("VR");
desktopCamera.enabled = false;
desktopWall.SetActive(false);
desktopPoster.SetActive(false);
}
else if (StartScript.vr == 1)
{
//normaler visual angle- noch mit Sebastian besprechen, wie der gemacht werden soll.
//aus paper: Winkel sollte in der großen Bedingung 80 Grad horizontal und 51 Grad vertical entsprechen
vrCamera.SetActive(false);
desktopWall.SetActive(true);
desktopPoster.SetActive(true);
}
else
{
print("VR Desktop");
desktopCamera.enabled = false;
desktopWall.SetActive(false);
desktopPoster.SetActive(false);
case 0:
print("VR");
desktopCamera.enabled = false;
desktopWall.SetActive(false);
desktopPoster.SetActive(false);
smallAngleModerator.SetActive(false);
break;
case 1:
print("Desktop");
vrCamera.SetActive(false);
desktopWall.SetActive(true);
desktopPoster.SetActive(true);
smallAngleModerator.SetActive(false);
break;
case 2:
print("VR Desktop");
desktopCamera.enabled = false;
desktopWall.SetActive(false);
desktopPoster.SetActive(false);
break;
case 3:
print("kleiner Winkel VR");
desktopCamera.enabled = false;
desktopWall.SetActive(false);
desktopPoster.SetActive(false);
smallAngleModerator.SetActive(true);
break;
default:
break;
}
}
void Start()
{
......@@ -120,7 +123,9 @@ public class GameManager : MonoBehaviour
allCubesSortedRight = true;
rightCubes = 0;
setNextCondition();
StartCoroutine(ConditionDelay());
ConditionDelay();
}
else if (rightCubes < 8)
......@@ -167,8 +172,7 @@ public class GameManager : MonoBehaviour
{
puzzleContainer.GetComponent<Puzzle>().setContainerMaterial(1);
//delete later:
// WriteLog();
}
else if (!puzzleSolved())
{
......@@ -229,7 +233,19 @@ public class GameManager : MonoBehaviour
IEnumerator ConditionDelay()
{
print("Delay");
//waits 5 Seconds before we start the next condition
//yield on a new YieldInstruction that waits for 5 seconds.
yield return new WaitForSeconds(5);
//After we have waited 5 seconds print the time again.
setPuzzleCubesToStartLocation();
puzzleContainer.GetComponent<Puzzle>().setContainerMaterial(0);
setNextCondition();
}
public void setNextCondition()
{
......@@ -258,7 +274,7 @@ public class GameManager : MonoBehaviour
}
else if (conditionOrder.Count == 0 && !lastCondition)
{
{
print("Study over");
lastCondition = true;
WriteLog();
......@@ -270,7 +286,7 @@ public class GameManager : MonoBehaviour
}
cubesInPuzzle = 0;
setPuzzleCubesToStartLocation();
}
......
......@@ -45,7 +45,7 @@ public class StartScript : MonoBehaviour
if (vpnummer.textComponent.text != "")
{
VPNummer = (vpnummer.textComponent.text);
vr = 0;
vr = 2;
SceneManager.LoadScene("DesktopVR");
}
}
......
......@@ -21,7 +21,7 @@ TagManager:
- UI
-
-
-
- Controller
-
-
-
......@@ -49,3 +49,6 @@ TagManager:
- name: Default
uniqueID: 0
locked: 0
- name: Controller
uniqueID: 3200922803
locked: 0
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment