示例#1
0
    private void InstantiateAudioSourceAndPlay(AudioClip clip)
    {
        AudioSource audioSource       = Instantiate(AudioPrefab, transform.position, transform.rotation) as AudioSource;
        Headache    audioSourceObject = audioSource.GetComponent <Headache>();

        audioSource.clip = clip;
        audioSource.Play();
    }
示例#2
0
 // unity awake
 void Awake()
 {
     // create the components
     m_waves         = gameObject.AddComponent <Waves>();
     m_headache      = gameObject.AddComponent <Headache>();
     m_coloredRays   = gameObject.AddComponent <ColoredRays>();
     m_lowResolution = gameObject.AddComponent <LowResolution>();
 }