71 lines
1.8 KiB
C#
71 lines
1.8 KiB
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class Radio : MonoBehaviour
|
|
{
|
|
//public AudioSource A_GFB;
|
|
|
|
|
|
public AudioClip Clip_GFB;
|
|
public AudioClip Clip_road;
|
|
public AudioClip Clip_lamp;
|
|
public AudioClip Clip_CDZ_road;
|
|
public AudioClip Clip_CDZ_station;
|
|
|
|
// Start is called before the first frame update
|
|
void Start()
|
|
{
|
|
//Action alip_1 = Audio_gfb;
|
|
//Audio_gfb();
|
|
}
|
|
public void Audio(AudioClip i)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
public void Audio_gfb()
|
|
{
|
|
if (!gameObject.GetComponent<AudioSource>().isPlaying)
|
|
{
|
|
gameObject.GetComponent<AudioSource>().clip = Clip_GFB;
|
|
gameObject.GetComponent<AudioSource>().Play();
|
|
}
|
|
}
|
|
public void Audio_road()
|
|
{
|
|
if (!gameObject.GetComponent<AudioSource>().isPlaying)
|
|
{
|
|
gameObject.GetComponent<AudioSource>().clip = Clip_road;
|
|
gameObject.GetComponent<AudioSource>().Play();
|
|
}
|
|
}
|
|
public void Audio_lamp()
|
|
{
|
|
if (!gameObject.GetComponent<AudioSource>().isPlaying)
|
|
{
|
|
gameObject.GetComponent<AudioSource>().clip = Clip_lamp;
|
|
gameObject.GetComponent<AudioSource>().Play();
|
|
}
|
|
}
|
|
public void Audio_CDZ_road()
|
|
{
|
|
if (!gameObject.GetComponent<AudioSource>().isPlaying)
|
|
{
|
|
gameObject.GetComponent<AudioSource>().clip = Clip_CDZ_road;
|
|
gameObject.GetComponent<AudioSource>().Play();
|
|
}
|
|
}
|
|
public void Audio_CDZ_station()
|
|
{
|
|
if (!gameObject.GetComponent<AudioSource>().isPlaying)
|
|
{
|
|
gameObject.GetComponent<AudioSource>().clip = Clip_CDZ_station;
|
|
gameObject.GetComponent<AudioSource>().Play();
|
|
}
|
|
}
|
|
}
|