際際滷

際際滷Share a Scribd company logo
Unityでゲ`ムを恬るスライド
for Public
UGUIとAudio
際際滷ShareID : Chy72 .
KMCID : murata
twitterID : paradigm_9
書晩やること
返乏
碧怏み
碧怏み
碧怏み
Audio Source
Audio Source
public class MusicPlayer : MonoBehaviour {
public AudioClip ClipA;
public AudioClip ClipB;
private AudioSource MyAudioSource;
void Start () {
MyAudioSource = this.GetComponent<AudioSource>();
}
void Update () {
if (Input.GetKeyDown(KeyCode.A)) {
MyAudioSource.clip = ClipA;
MyAudioSource.Play();
} else if (Input.GetKeyDown(KeyCode.B)) {
MyAudioSource.clip = ClipB;
MyAudioSource.Play();
}
}
}
Audio Source
UGUI
UGUI
UGUI
public class MusicPlayer : MonoBehaviour {
public AudioClip ClipA;
public AudioClip ClipB;
private AudioSource MyAudioSource;
void Start () {
MyAudioSource =this.GetComponent<AudioSource>();
}
public void PlayA() {
MyAudioSource.clip = ClipA;
MyAudioSource.Play();
}
public void PlayB() {
MyAudioSource.clip = ClipB;
MyAudioSource.Play();
}
}
Button
UGUI
際際滷r
際際滷r
public void ChangeVolume() {
UnityEngine.UI.際際滷r slider = GameObject.Find(^Volume ̄).
GetComponent<UnityEngine.UI.際際滷r>();
MyAudioSource.volume = slider.value;
}
永温稼處楼
雨赫雨鴛の瓜り
AudioMixer
AudioMixer
AudioMixer
AudioMixer
AudioMixer
public UnityEngine.Audio.AudioMixer audioMixer;
public void ChangeDryMix() {
var slider =GameObject.Find("DryMix").GetComponent<UnityEngine.UI.際際滷r>();
audioMixer.SetFloat("DryMix",slider.value);
}
AudioMixer
Mask
Mask
Vertical Layout Group
Vertical Layout Group
Vertical Layout Group
Scroll Rect
Scroll Rect
Scroll Rect
LayoutElement
LayoutElement
LayoutElement
LayoutElement

More Related Content

Unity2015_No8_~UGUI&Audio~