Beispiel #1
0
        private IEnumerator Start()
        {
            //Check clip length
            AudioClip clip = GetComponent <AudioSource>().clip;

            if (!clip)
            {
                PhotonUtils.Destroy(this);
                yield break;
            }

            //Delayed destruction
            yield return(new WaitForSeconds(clip.length));

            PhotonUtils.Destroy(this);
        }