本文整理汇总了C#中UnityEngine.AudioClip.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# AudioClip.ToString方法的具体用法?C# AudioClip.ToString怎么用?C# AudioClip.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UnityEngine.AudioClip
的用法示例。
在下文中一共展示了AudioClip.ToString方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: if
// Use this for initialization
// Update is called once per frame
/*void Update () {
if(Input.GetKeyDown (KeyCode.Space))
//GetComponent<ParticleSystem>().Emit(300);
photonView.RPC("DoExploder",PhotonTargets.All, new object[]{1500});
else if(Input.GetKeyDown (KeyCode.Return))
//GetComponent<ParticleSystem>().Emit(1500);
photonView.RPC("DoExploder",PhotonTargets.All, new object[]{1500});
}
*/
public void PlaySound(AudioClip clip){
stringclip = clip.ToString();
Debug.Log (stringclip);
photonView.RPC("PlaySoundHandler",PhotonTargets.All, null);
//explosions
photonView.RPC("DoExploder",PhotonTargets.All, new object[]{15});
}
示例2: CreateClip
public static AudioSource CreateClip(AudioClip clip, float volume, float pitch)
{
if (GameObject.Find(clip.name) != null)
return null;
AudioSource source = CreateSource();
source.clip = clip;
source.volume = volume;
source.pitch = pitch;
source.spatialBlend = 0;
source.gameObject.name = clip.name;
Debug.Log((GameObject.Find(clip.ToString()) == null) + " " + clip.ToString() );
source.Play();
// Registrar la fuente de sonido
AudioSettings.RegisterClip(source);
return source;
}
示例3: Awake
void Awake()
{
audioSource = GetComponent<AudioSource>();
sound = audioSource.clip;
argument = sound.ToString();
string newstring = argument.Replace(" (UnityEngine.AudioClip)", "");
argument = newstring;
AudioManager.AddAudioToDictionary(argument, gameObject);
AudioManager.AddListener(audioEvent, sound3D);
}
示例4: PlayOneShot
public void PlayOneShot(AudioClip clip, float volume = 1f)
{
if(audio != null)
{
if(clip !=null && clip.isReadyToPlay)
{
audio.PlayOneShot(clip, volume);
}
else
{
Log.i ("clicp " + clip.ToString() + "is not ready to play...");
}
}
else
{
Log.i("audio null...");
}
}
示例5: NullTest
//Null test for arrays
private AudioClip NullTest(AudioClip[] TestArray, int i)
{
if( (i + 1) <= TestArray.Count())
{
if (TestArray[i])
return TestArray[i];
else
return ErrorSound;
}
else
{
Debug.Log("ERROR: No Audiosource at: " + TestArray.ToString() +" "+ i.ToString());
return ErrorSound;
}
}