Skip to content
Snippets Groups Projects
Commit 4a4ef14d authored by Sofiane Lasri's avatar Sofiane Lasri
Browse files

changed sounds & modified script

parent e2d16863
Branches
No related tags found
No related merge requests found
Showing
with 60 additions and 6 deletions
fileFormatVersion: 2
guid: 63df594e9b289e7439037d99a0d7b8b7
guid: b78509a2d4b856f4aa0687ad6171b61a
folderAsset: yes
DefaultImporter:
externalObjects: {}
......
File moved
File moved
File moved
File moved
File moved
File moved
File moved
File moved
File added
fileFormatVersion: 2
guid: 8f5a3c42ff38ada479cb7054583c22f9
guid: 274a03e4eb6960c42b6dcd358e47cb76
AudioImporter:
externalObjects: {}
serializedVersion: 6
......
File added
fileFormatVersion: 2
guid: c0885d4cda9795248a2405d80adbc9b6
guid: 5ef0d2ea04bf3434596e17df35873a0a
AudioImporter:
externalObjects: {}
serializedVersion: 6
......
File added
fileFormatVersion: 2
guid: c56c273cd56e24543ad2bd1e7c9eb2e7
guid: b7534d0ea4416e348951c7822084f855
AudioImporter:
externalObjects: {}
serializedVersion: 6
......
File added
fileFormatVersion: 2
guid: 9329724e761e86641bbb630557b13766
guid: c204148e92eeaf8408f47b8713ed2520
AudioImporter:
externalObjects: {}
serializedVersion: 6
......
......@@ -671,7 +671,7 @@ MonoBehaviour:
m_GameObject: {fileID: 1287863552}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 178af3f4a5e3bec4aa442ee5caf6873d, type: 3}
m_Script: {fileID: 11500000, guid: 37ac42a67d44ad94189d0d12756ab083, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1001 &1300852977
......
fileFormatVersion: 2
guid: 43ed5e951bb67d0408b8a776d1f80154
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
// Pour intéragir avec l'interface HTML
using ZenFulcrum.EmbeddedBrowser;
public class Menu : MonoBehaviour
public class UI : MonoBehaviour
{
AudioSource audioSource;
// Naviguateur intégré
private Browser browser;
// Start is called before the first frame update
void Start()
{
// On initialise l'audio Source
GetComponent<AudioListener>().enabled = true;
if(GetComponent<AudioSource>() != null)
{
audioSource = GetComponent<AudioSource>();
} else
{
audioSource = gameObject.AddComponent<AudioSource>();
}
audioSource.playOnAwake = false;
audioSource.loop = false;
audioSource.volume = 0.5f;
// On initialise le navigateur
browser = GameObject.Find("Browser (GUI)").GetComponent<Browser>();
browser.RegisterFunction("quitGame", args => Application.Quit());
browser.RegisterFunction("PlaySound", args => this.PlaySound(args[0]));
}
// Update is called once per frame
......@@ -23,4 +37,10 @@ public class Menu : MonoBehaviour
{
}
public void PlaySound(string soundName)
{
AudioClip clip = Resources.Load<AudioClip>("Sounds/UI/" + soundName);
audioSource.PlayOneShot(clip);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment