FMOD_StudioEventEmitter.CacheEventInstance C# (CSharp) Method

CacheEventInstance() public method

public CacheEventInstance ( ) : void
return void
    void CacheEventInstance()
    {
        if (asset != null)
        {
            evt = FMOD_StudioSystem.instance.getEvent(asset.id);
        }
        else if (!String.IsNullOrEmpty(path))
        {
            evt = FMOD_StudioSystem.instance.getEvent(path);
        }
        else
        {
            FMOD.Studio.UnityUtil.LogError("No asset or path specified for Event Emitter");
        }
    }

Usage Example

コード例 #1
0
    public void StartEvent(string key, AudioChannel channel = AudioChannel.Action, bool stopPre = true, string para = "", float value = 0f)
    {
        FMOD_StudioEventEmitter emitter = this.GetEmitter(channel);

        if (stopPre)
        {
            emitter.OnDestroy();
        }
        if (!string.IsNullOrEmpty(key))
        {
            emitter.path = key;
        }
        emitter.CacheEventInstance();
        this.SetParamValue(channel, para, value);
        if (this._3dPos != Vector3.zero)
        {
            emitter.Update3DAttributes(this._3dPos);
            this._3dPos = Vector3.zero;
        }
        emitter.StartEvent();
    }