# Event Reference Updater doesn't detect changes in scriptable objects

**URL:** https://qa.fmod.com/t/event-reference-updater-doesnt-detect-changes-in-scriptable-objects/20727
**Category:** Unity
**Tags:** csharp, unity
**Created:** [October 3, 2023, 5:55pm UTC](https://qa.fmod.com/t/event-reference-updater-doesnt-detect-changes-in-scriptable-objects/20727 "2023-10-03T17:55:21Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Hzo420](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/hzo420/32/3827_2.png) [@Hzo420](https://qa.fmod.com/u/Hzo420)
#### Post date: [October 3, 2023, 5:55pm UTC](https://qa.fmod.com/t/event-reference-updater-doesnt-detect-changes-in-scriptable-objects/20727/1 "2023-10-03T17:55:21Z")

</div>

Hello,

We’re using ScriptableObjects as sound containers in our project. They contain a List of a custom class “SoundEvent”, which has an EventReference field inside. Unfortunately, the Event Reference Updater doesn’t seem to be able to detect changes in these EventReferences whenever we rename events in FMOD Studio. Is there any way I could modify the EventReferenceUpdater script to find and update the changes in these references? I’m attaching the relevant snippets of code for context below.

Scriptable Object:

```auto
using System.Collections.Generic;
using UnityEngine;

namespace Eof.Sound
{
    public class SoundHolderSO : ScriptableObject
    {
        [SerializeField] private List<SoundEvent> soundEvents = new();
        [SerializeField] private List<MusicEvent> musicEvents = new();
        public List<SoundEvent> SoundEvents => soundEvents;
        public List<MusicEvent> MusicEvents => musicEvents;
    }
}

```

SoundEvent:

```auto
using System;
using FMODUnity;
using UnityEngine;
using Eof.Tools;

namespace Eof.Sound
{
    [Serializable]
    public class SoundEvent
    {
        [SerializeField] protected SoundActionType actionType = SoundActionType.Start;
        [SerializeField] protected SoundHandlerTrigger trigger;
        [SerializeField, SoundAnimationTrigger, SoundAnimationClip] protected AnimationClip animationClip;
        [SerializeField, SoundAnimationTrigger] protected int animationFrame; 
        [SerializeField] protected EventReference reference;
        [SerializeField] protected bool followsTransform = true;

        [HideInInspector] [SerializeField] protected FMOD.GUID eventID;

        public EventReference Reference => reference;
        public SoundHandlerTrigger Trigger => trigger;
        public SoundActionType ActionType => actionType;
        public AnimationClip AnimationClip => animationClip;
        public int AnimationFrame => animationFrame;
    }
}

```

Thanks.

---

<div class="post-metadata">

### Author: ![Connor\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/connor_fmod/32/3685_2.png) [@Connor\_FMOD](https://qa.fmod.com/u/Connor_FMOD)
#### Post date: [October 6, 2023, 1:09am UTC](https://qa.fmod.com/t/event-reference-updater-doesnt-detect-changes-in-scriptable-objects/20727/2 "2023-10-06T01:09:45Z")

</div>

Hi,

So the issue is our `EventReferenceUpdater` will only look surface level on objects for references. I will pass on the suggestion to improve this to our development team to look into further, thank you for the suggestion.  
You could possibly add a new search field in the `GetGenericUpdateTasks()` on line `519` of the `EventReferenceUpdater.cs` to search for your `SoundHolderSO` objects using any of the members of `FieldInfo`. This will require also referencing an `Assembly-CSharp` class in our `FMODUnityEditor` assembly.

Hope this helps.
