Пример #1
0
        void OnEnable()
        {
            AudioSource audioSource = this.GetComponent <AudioSource>();

            if (audioSource && audioSource.clip)
            {
                audioSource.PlayOneShot(audioSource.clip, 0f);
            }

            Debug.Assert(_sourceInstance == System.IntPtr.Zero);
            _sourceInstance = NativePlugin.AddAmbisonicSourceInstance(Ambisonic.MaxCoeffs);

            _position = this.transform.position;
            UpdateCoefficients();
            if (_sink)
            {
                _sink.AddSource(this);
            }
        }