Exemplo n.º 1
0
    // Update is called once per frame
    void Update()
    {
        if (m_bSoundPlayed)
        {
            if (m_SoundGO == null)
            {
                VisibleHazardController.ShowHazards(gameObject);

                Destroy(gameObject);
            }
        }

        if (Input.GetMouseButtonDown(0) && !m_bSoundPlayed)
        {
            RaycastHit hit;
            Ray        ray = Camera.main.ScreenPointToRay(Input.mousePosition);

            if (GetComponent <Collider>().Raycast(ray, out hit, 100f))
            {
                m_SoundGO      = SimpleSoundClip.PlaySound(MediaNodeManager.LoadAudioClipResource(SoundResource.name));
                m_bSoundPlayed = true;

                VisibleHazardController.HideHazards(gameObject);
            }
        }
    }
Exemplo n.º 2
0
    void Start()
    {
#if (!UNITY_ANDROID && !UNITY_IOS)
        SimpleSoundClip.PlaySound(MediaNodeManager.LoadAudioClipResource(SoundResource.name));
        ((MovieTexture)moviePlane.material.mainTexture).Play();
#endif
    }
Exemplo n.º 3
0
 void OnEnable()
 {
     m_SoundGO = SimpleSoundClip.PlaySound(MediaNodeManager.LoadAudioClipResource(SoundResource.name));
     m_bPlayed = true;
 }
Exemplo n.º 4
0
    // Use this for initialization
    void Start()
    {
        AudioSource audioSource = SimpleSoundClip.PlaySound((AudioClip)Resources.Load(SoundResource.name), Loop).GetComponent <AudioSource>();

        audioSource.volume = Volume;
    }
Exemplo n.º 5
0
 // Use this for initialization
 void Start()
 {
     m_Sound = SimpleSoundClip.PlaySound((AudioClip)Resources.Load("Audio/Scene1"));
 }