コード例 #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);
            }
        }
    }
コード例 #2
0
    void Start()
    {
#if (!UNITY_ANDROID && !UNITY_IOS)
        SimpleSoundClip.PlaySound(MediaNodeManager.LoadAudioClipResource(SoundResource.name));
        ((MovieTexture)moviePlane.material.mainTexture).Play();
#endif
    }
コード例 #3
0
 void OnEnable()
 {
     m_SoundGO = SimpleSoundClip.PlaySound(MediaNodeManager.LoadAudioClipResource(SoundResource.name));
     m_bPlayed = true;
 }