Skip to content

Commit

Permalink
Merge pull request #22 from MV50-Project/feature-changeSceneProperly+map
Browse files Browse the repository at this point in the history
feature selection de la musique en fonction du disque
  • Loading branch information
gregmetral authored Jun 6, 2024
2 parents a6c1f0a + fbbc38f commit 6777d41
Show file tree
Hide file tree
Showing 11 changed files with 264 additions and 49 deletions.
283 changes: 245 additions & 38 deletions Assets/Resources/song1Map.json

Large diffs are not rendered by default.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion Assets/Scenes/MainMenu.unity
Original file line number Diff line number Diff line change
Expand Up @@ -2691,7 +2691,7 @@ MonoBehaviour:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1213942263}
m_Enabled: 1
m_Enabled: 0
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0ee573f7b21ae8d45941dd9c0bc55fed, type: 3}
m_Name:
Expand Down
2 changes: 1 addition & 1 deletion Assets/Scenes/SampleScene.unity
Original file line number Diff line number Diff line change
Expand Up @@ -3966,7 +3966,7 @@ MonoBehaviour:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1038674918}
m_Enabled: 1
m_Enabled: 0
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0ee573f7b21ae8d45941dd9c0bc55fed, type: 3}
m_Name:
Expand Down
4 changes: 4 additions & 0 deletions Assets/prefabs/spheres/discoBall.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ PrefabInstance:
propertyPath: m_Name
value: discoBall
objectReference: {fileID: 0}
- target: {fileID: 919132149155446097, guid: 985c6436c58a8264dbc01b3c3911a7b7, type: 3}
propertyPath: m_TagString
value: cible
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
Expand Down
7 changes: 5 additions & 2 deletions Assets/scripts/GameController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@ private class Root

private void Start()
{
TextAsset map = Resources.Load<TextAsset>("song1Map");

string entryMethod = PlayerPrefs.GetString("EntryMethod", "none");
Debug.Log(entryMethod);
TextAsset map = Resources.Load<TextAsset>(entryMethod);
readJsonMap(map);
Debug.Log("lecture terminee");
Debug.Log(songName);
Expand All @@ -97,7 +100,7 @@ private void Start()

audioSource = GetComponent<AudioSource>();
//AudioClip audioClip = Resources.Load<AudioClip>("song1_noLead");
AudioClip audioClip = Resources.Load<AudioClip>("test");
AudioClip audioClip = Resources.Load<AudioClip>(entryMethod);

leadNotes[0] = Resources.Load<AudioClip>("sound1");
leadNotes[1] = Resources.Load<AudioClip>("sound2");
Expand Down
1 change: 1 addition & 0 deletions Assets/scripts/GrabbableBehavior.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ private void OnTriggerEnter(Collider other)
TryRelease(grabber);
}
grabType = GrabType.None;
PlayerPrefs.SetString("EntryMethod", "song1Map");

//SceneManager.LoadScene("SampleScene");
}
Expand Down
14 changes: 7 additions & 7 deletions Assets/scripts/LaserHit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,13 @@ private void FixedUpdate()
if (hit.rigidbody)
{
GameObject sphereHit = hit.rigidbody.gameObject;
AudioSource soundHit = hit.rigidbody.gameObject.GetComponent<AudioSource>();
sphereHit.transform.position = new Vector3(0, -2f, 0);
soundHit.Play();
StartCoroutine(DestroyObjectAfterDelay(sphereHit, 1f));



if (sphereHit.CompareTag("cible"))
{
AudioSource soundHit = hit.rigidbody.gameObject.GetComponent<AudioSource>();
sphereHit.transform.position = new Vector3(0, -2f, 0);
soundHit.Play();
StartCoroutine(DestroyObjectAfterDelay(sphereHit, 1f));
}



Expand Down

0 comments on commit 6777d41

Please sign in to comment.