mirror of
https://github.com/nick7ass/NNMDETGroupProject.git
synced 2025-04-14 09:50:35 +02:00
Everything working properly, only adjustments made. Reset scene mechanic implemented and working
This commit is contained in:
parent
5c75ae875e
commit
ab6a148468
.DS_Store
Assets
.DS_Store
1OurESP32Scripts
1OurScripts
BoundAirScript.csBoundEarthScript.csBoundFireScript.csBoundWaterScript.csBoundaryControlScript.csConnectUnityWithSensors.csRestartExperienceScript.csRestartExperienceScript.cs.meta
Inguz Media Studio
Scenes
BIN
.DS_Store
vendored
BIN
.DS_Store
vendored
Binary file not shown.
BIN
Assets/.DS_Store
vendored
BIN
Assets/.DS_Store
vendored
Binary file not shown.
BIN
Assets/1OurESP32Scripts/.DS_Store
vendored
BIN
Assets/1OurESP32Scripts/.DS_Store
vendored
Binary file not shown.
@ -55,10 +55,10 @@ void loop() {
|
||||
//touchValue = touchRead(4);
|
||||
|
||||
|
||||
while (touchRead(4) < 30000) {
|
||||
while (touchRead(4) < 36000) {
|
||||
Serial.println(touchRead(4));
|
||||
delay(400);
|
||||
if (touchRead(4) >= 30000) {
|
||||
if (touchRead(4) >= 36000) {
|
||||
Serial.println("Value above threshold");
|
||||
|
||||
rotateServo();
|
||||
@ -82,7 +82,7 @@ void rotateServo() {
|
||||
|
||||
for (int posDegrees = 0; posDegrees <= 180; posDegrees++) {
|
||||
servo1.write(posDegrees);
|
||||
delay(5); // Adjust the delay for smooth rotation
|
||||
delay(10); // Adjust the delay for smooth rotation
|
||||
}
|
||||
|
||||
for (int posDegrees = 180; posDegrees >= 0; posDegrees--) {
|
||||
|
@ -146,7 +146,7 @@ public class BoundAirScript : MonoBehaviour
|
||||
{
|
||||
StartCoroutine(RemoveCollectedItem());
|
||||
windObjectToCollect.SetActive(false);
|
||||
boundControl.ReactivateBoundary();
|
||||
//boundControl.ReactivateBoundary();
|
||||
boundControl.RemoveBoundary("Air");
|
||||
}
|
||||
|
||||
|
@ -67,7 +67,7 @@ public class BoundEarthScript : MonoBehaviour
|
||||
{
|
||||
StartCoroutine(RemoveCollectedItem());
|
||||
earthObjectToCollect.SetActive(false);
|
||||
boundControl.ReactivateBoundary();
|
||||
//boundControl.ReactivateBoundary();
|
||||
boundControl.RemoveBoundary("Earth");
|
||||
}
|
||||
|
||||
|
@ -51,7 +51,7 @@ public class BoundFireScript : MonoBehaviour
|
||||
public void CollectFireObject()
|
||||
{
|
||||
StartCoroutine(SecondNarrationAndObject());
|
||||
audioSource.PlayOneShot(narrationClipTwo);
|
||||
//audioSource.PlayOneShot(narrationClipTwo);
|
||||
fireObjectToCollect.SetActive(true);
|
||||
|
||||
}
|
||||
@ -74,7 +74,7 @@ public class BoundFireScript : MonoBehaviour
|
||||
{
|
||||
StartCoroutine(RemoveCollectedItem());
|
||||
fireObjectToCollect.SetActive(false);
|
||||
boundControl.ReactivateBoundary();
|
||||
//boundControl.ReactivateBoundary();
|
||||
boundControl.RemoveBoundary("Fire");
|
||||
}
|
||||
|
||||
|
@ -68,7 +68,7 @@ public class BoundWaterScript : MonoBehaviour
|
||||
{
|
||||
StartCoroutine(RemoveCollectedItem());
|
||||
waterObjectToCollect.SetActive(false);
|
||||
boundControl.ReactivateBoundary();
|
||||
//boundControl.ReactivateBoundary();
|
||||
boundControl.RemoveBoundary("Water");
|
||||
}
|
||||
|
||||
|
@ -83,7 +83,8 @@ public class BoundaryControlScript : MonoBehaviour
|
||||
{
|
||||
airFinished = true;
|
||||
collectionCounter++;
|
||||
PlayCollectionNarration();
|
||||
//PlayCollectionNarration();
|
||||
StartCoroutine(PlayCollectionNarration());
|
||||
airHasBeenCollected = true;
|
||||
airBoundary.SetActive(false);
|
||||
}
|
||||
@ -91,7 +92,9 @@ public class BoundaryControlScript : MonoBehaviour
|
||||
{
|
||||
earthFinished = true;
|
||||
collectionCounter++;
|
||||
PlayCollectionNarration();
|
||||
//PlayCollectionNarration();
|
||||
StartCoroutine(PlayCollectionNarration());
|
||||
|
||||
earthHasBeenCollected = true;
|
||||
earthBoundary.SetActive(false);
|
||||
}
|
||||
@ -99,7 +102,9 @@ public class BoundaryControlScript : MonoBehaviour
|
||||
{
|
||||
waterFinished = true;
|
||||
collectionCounter++;
|
||||
PlayCollectionNarration();
|
||||
//PlayCollectionNarration();
|
||||
StartCoroutine(PlayCollectionNarration());
|
||||
|
||||
waterHasBeenCollected = true;
|
||||
waterBoundary.SetActive(false);
|
||||
}
|
||||
@ -107,19 +112,24 @@ public class BoundaryControlScript : MonoBehaviour
|
||||
{
|
||||
fireFinished = true;
|
||||
collectionCounter++;
|
||||
PlayCollectionNarration();
|
||||
//PlayCollectionNarration();
|
||||
StartCoroutine(PlayCollectionNarration());
|
||||
|
||||
fireHasBeenCollected = true;
|
||||
fireBoundary.SetActive(false);
|
||||
}
|
||||
}
|
||||
private void PlayCollectionNarration()
|
||||
IEnumerator PlayCollectionNarration()
|
||||
{
|
||||
if (collectionCounter > 0 && collectionCounter <= narrationClips.Length)
|
||||
{
|
||||
narrationSource.Stop();
|
||||
narrationSource.clip = narrationClips[collectionCounter - 1];
|
||||
narrationSource.Play();
|
||||
yield return new WaitForSeconds(narrationClips[collectionCounter - 1].length);
|
||||
ReactivateBoundary();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//ADD functionality for detecting when all elements have been collected (eg when collectionCounter
|
||||
|
@ -64,7 +64,7 @@ public class ConnectUnityWithSensors : MonoBehaviour
|
||||
|
||||
if (forceDataReceived)
|
||||
{
|
||||
if (receivedForceValue > 900)
|
||||
if (receivedForceValue > 100)
|
||||
{
|
||||
Debug.Log("Force threshold exceeded, action triggered.");
|
||||
isForceDetected = true;
|
||||
|
30
Assets/1OurScripts/RestartExperienceScript.cs
Normal file
30
Assets/1OurScripts/RestartExperienceScript.cs
Normal file
@ -0,0 +1,30 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
public class RestartExperienceScript : MonoBehaviour
|
||||
{
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void OnTriggerEnter(Collider other)
|
||||
{
|
||||
if (other.CompareTag("BoundHMD"))
|
||||
{
|
||||
SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
11
Assets/1OurScripts/RestartExperienceScript.cs.meta
Normal file
11
Assets/1OurScripts/RestartExperienceScript.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9306a274e4e6645999f1109d1d59f44a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
BIN
Assets/Inguz Media Studio/.DS_Store
vendored
BIN
Assets/Inguz Media Studio/.DS_Store
vendored
Binary file not shown.
Binary file not shown.
@ -116,7 +116,7 @@ Material:
|
||||
- _ZWrite: 1
|
||||
m_Colors:
|
||||
- _BaseColor: {r: 0.17924526, g: 0.11463053, b: 0.026210394, a: 1}
|
||||
- _Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _Color: {r: 0.17924523, g: 0.1146305, b: 0.026210394, a: 1}
|
||||
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
|
||||
m_BuildTextureStacks: []
|
||||
|
@ -49,7 +49,7 @@ Material:
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _MainTex:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Texture: {fileID: 2800000, guid: 18fc5acde6bc24fcca8b7ac96b07b261, type: 3}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _MetallicGlossMap:
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user