示例#1
0
    public override void OnPlay()
    {
        uniqueID = SubItem.clipref.name + "__" + (++globalCounter).ToString();
        string path = SubItem.clipref.StreamingAssetPath;

        #if !UNITY_EDITOR && UNITY_ANDROID
        path = SubItem.clipref.StreamingAssetPathRelative.Replace(".caf", ".ogg");
        path = path.Replace("iOS", "Android");//temp
        #endif
        LLSoundManager.PlaySound(uniqueID, path, TotalVolume, Pitch, Loop, transform.position, MinDistance, MaxDistance, SpatialBlend);
        Register(this, uniqueID);
    }
示例#2
0
    void UpdateListenerPosition()
    {
        AudioListener listener = GetCurrentAudioListener();

        if (listener != null)
        {
            Vector3 pos = listener.transform.position;
            if (pos != listenerLastPosition)
            {
                LLSoundManager.SetListenerPosition(pos);
            }
            listenerLastPosition = pos;
        }
    }
示例#3
0
    protected override void LateUpdate()
    {
        Vector3 pos = transform.position;

        if (lastPosition != pos)
        {
            IsDirty      = true;
            lastPosition = pos;
        }

        if (IsDirty)
        {
            LLSoundManager.UpdateSound(uniqueID, TotalVolume, Pitch, Loop, transform.position, MinDistance, MaxDistance, SpatialBlend);
        }

        base.LateUpdate();
    }
示例#4
0
 internal override void StopSound()
 {
     base.StopSound();
     LLSoundManager.StopSound(uniqueID);
     Unregister(this, uniqueID);
 }
示例#5
0
 protected override void ApplyPause()
 {
     LLSoundManager.PauseSound(uniqueID, IsPaused);
 }