[Unity] ๋ฐฐ๊ฒฝ ์์
๋๋ค ํ๋ ์ด
2019. 8. 11. 00:15
๊ฒ์ ํ๋ ์ด ์, ์ฌ๋ฌ ๊ฐ์ ๋ฐฐ๊ฒฝ ์์
์ ๋๋ค์ผ๋ก ๊ณ์ ํ๋ ์ด ํ๋ ๋ฐฉ๋ฒ โ ์คํฌ๋ฆฝํธ ์์ฑ using System.Collections; using System.Collections.Generic; using UnityEngine; public class BGMplayer : MonoBehaviour { public AudioClip[] Music = new AudioClip[4]; // ์ฌ์ฉํ BGM AudioSource AS; void Awake() { AS = this.GetComponent(); } void Update() { if (!AS.isPlaying) RandomPlay(); } void RandomPlay() { AS.clip = Music[Random.Range(0, Music.Len..