FMOD.Studio.EventInstance.setProperty C# (CSharp) Method

setProperty() public method

public setProperty ( EVENT_PROPERTY index, float value ) : RESULT
index EVENT_PROPERTY
value float
return RESULT
        public RESULT setProperty(EVENT_PROPERTY index, float value)
        {
            return FMOD_Studio_EventInstance_SetProperty(rawPtr, index, value);
        }
        public RESULT getPaused(out bool paused)

Usage Example

Beispiel #1
0
    // Use this for initialization
    public void Init(LevelManager lm, float t)
    {
        _levelManager = lm;
        timeShowing   = t;

        // Event description for creating the scream event instance
        FMOD.Studio.EventDescription screamDescription;
        SoundSystem.instance.ErrorCheck(SoundSystem.instance.GetStudioSoundSystem().getEvent("event:/Scream", out screamDescription));
        SoundSystem.instance.ErrorCheck(screamDescription.createInstance(out _screamInstance));

        // Event description for creating the spawn event instance
        FMOD.Studio.EventDescription spawnDescription;
        SoundSystem.instance.ErrorCheck(SoundSystem.instance.GetStudioSoundSystem().getEvent("event:/HelloCivil", out spawnDescription));
        SoundSystem.instance.ErrorCheck(spawnDescription.createInstance(out _spawnInstance));

        // Set the 3d attributes of this sound depending on this script's owner
        _attributes3D = FMODUnity.RuntimeUtils.To3DAttributes(this.gameObject, this.gameObject.GetComponent <Rigidbody>());
        _screamInstance.set3DAttributes(_attributes3D);
        _spawnInstance.set3DAttributes(_attributes3D);

        // Set the minimum and maximum distances for this sound event
        SoundSystem.instance.ErrorCheck(_screamInstance.setProperty(FMOD.Studio.EVENT_PROPERTY.MINIMUM_DISTANCE, 3.0f));
        SoundSystem.instance.ErrorCheck(_screamInstance.setProperty(FMOD.Studio.EVENT_PROPERTY.MAXIMUM_DISTANCE, 30.0f));


        // Set the minimum and maximum distances for scream event instance
        SoundSystem.instance.ErrorCheck(_spawnInstance.setProperty(FMOD.Studio.EVENT_PROPERTY.MINIMUM_DISTANCE, 3.0f));
        SoundSystem.instance.ErrorCheck(_spawnInstance.setProperty(FMOD.Studio.EVENT_PROPERTY.MAXIMUM_DISTANCE, 30.0f));

        _spawnInstance.start();
    }
All Usage Examples Of FMOD.Studio.EventInstance::setProperty
EventInstance