public static void DestroyMenuSound() { if (instance != null) { Destroy(instance.gameObject); instance = null; } }
private void Awake() { sound = GetComponent <MenuSound>(); SetScaleToZero(menuButtons); SetScaleToZero(title); SetScaleToZero(credits); StartCoroutine("StartAnimation"); }
public bool Play(MenuSound sound) { if (sounds.TryGetValue(sound, out SoundEffect sfx)) { return(sfx.Play()); } return(false); }
void Awake() { if (instance != null && instance != this) { Destroy (this.gameObject); return; } else { instance = this; } DontDestroyOnLoad (this.gameObject); }
// Start is called before the first frame update void Start() { _rb = GetComponent <Rigidbody>(); cam = Camera.main; my = GetComponent <Transform>(); _lifepts = 5; //NB de points de vie du joueur _menuSound = FindObjectOfType <MenuSound>(); _audM = FindObjectOfType <AudioManager>(); }
private void Awake() { if (instance == null) { instance = this; DontDestroyOnLoad(gameObject); } else { Destroy(gameObject); } }
void Awake() { if (menuSound == null) { DontDestroyOnLoad(gameObject); menuSound = this; } else if (menuSound != this) { Destroy(gameObject); } }
void Awake() { if (MenuSound.menuSound != null && MenuSound.menuSound != this) { Destroy(this.gameObject); } else { MenuSound.menuSound = this; } DontDestroyOnLoad(MenuSound.menuSound.gameObject); }
// Start is called before the first frame update void Start() { _speed = 2.0f; _life = 3; _player = GameObject.FindWithTag("Player"); p1 = GameObject.Find("Player").GetComponent <Player>(); cA = GameObject.Find("Ground").GetComponent <CleanArea>(); _menuSound = FindObjectOfType <MenuSound>(); _audM = FindObjectOfType <AudioManager>(); _audM._Spawn.clip = _menuSound._clips[5]; _audM._Spawn.Play(); }
// Start is called before the first frame update void Start() { _sp = GameObject.Find("GameManager").GetComponent <Spawner>(); m_Material = GetComponent <Renderer>().material; e_Deaths = 0; _N1.SetActive(true); _N2.SetActive(false); _menuSound = FindObjectOfType <MenuSound>(); _audM = FindObjectOfType <AudioManager>(); //_zC.gameObject.SetActive(false); }
void Start() { instance = this; DontDestroyOnLoad(gameObject); asource = GetComponent <AudioSource> (); if (PreLoader.Instance.musicState) { asource.enabled = true; } else { asource.enabled = false; } }
//public AudioSource _audioSource; // Start is called before the first frame update void Start() { _menuSound = FindObjectOfType <MenuSound>(); _audM = FindObjectOfType <AudioManager>(); //_audioSource = Camera.main.GetComponent<AudioSource>(); _speed = 2.0f; _player = GameObject.FindWithTag("Player"); _life = 6; cA = GameObject.Find("Ground").GetComponent <CleanArea>(); _rb = GetComponent <Rigidbody>(); //_source = //GameObject.Find("AudioManager").GetComponent<AudioSource>(); //_clips = GameObject.Find("AudioManager").GetComponent<AudioClip>()._clips; //_source.Play(_clips[7]); _audM._Spawn.clip = _menuSound._clips[5]; _audM._Spawn.Play(); StartCoroutine("ShootBehave1"); StartCoroutine("AwayOfSpawn"); //_audioSource.clip = _menuSound._clips[5]; //_audioSource.Play(); }
public void turnMusicOff() { if (instance != null) { Destroy (this.gameObject); instance = null; } }
void OnApplicationQuit() { instance = null; }
private void Start() { MenuSound.DestroyMenuSound(); }
private void Awake() { sound = GetComponent <MenuSound>(); areYouSure.SetActive(false); }
void Awake() { sm = gameObject.GetComponent <MenuSound> (); }
private void Awake() { sound = controller.GetComponent <MenuSound>(); }
private void Awake() { sound = GetComponent <MenuSound>(); }