コード例 #1
0
        /// <summary>
        /// Set all properties on the engine instance. The base implementation already sets position and orientation,
        /// so there is nothing else to do here
        /// </summary>
        public override void SetEngineInstanceBaseProperties()
        {
            if (_engineInstance == null)
            {
                return;
            }
            EngineFmodSound.InitSound(_filename, SoundFlags | FmodCreationFlags_e.Paused, _iPriority); // first, set the file, so the native instance is created
            base.SetEngineInstanceBaseProperties();                                                    // now set position etc.
            EngineFmodSound.SetVolume(_fVolume);
            EngineFmodSound.SetPitch(_fPitch);
            EngineFmodSound.SetPan(_fPan);
            EngineFmodSound.Set3DFadeDistance(_fFadeMin * UniformScaling, _fFadeMax * UniformScaling);
            EngineFmodSound.SetConeAngles(_bDirectional, _fConeInside, _fConeOutside);

            // Only play the sound in case we are in play mode (not in editing mode)
            if ((SoundFlags & FmodCreationFlags_e.Paused) == 0)
            {
                EngineFmodSound.Play(false);

                // The native class will not play the sound if we are in editing mode, and thus
                // keep the sound paused. Make sure that it is marked as playing, so that the flag
                // is exported correctly.
                EngineFmodSound.RemoveFlag(FmodCreationFlags_e.Paused);
            }

            UpdateHotspotVisibility();
            RecreateCustomLinks();
        }