# Serialize an EventReference for a CustomEditor without a serializedObject

**URL:** <https://qa.fmod.com/t/serialize-an-eventreference-for-a-customeditor-without-a-serializedobject/23458>\
**Category:** Unity\
**Tags:** unity\
**Created:** [October 12, 2025, 4:19pm UTC](https://qa.fmod.com/t/serialize-an-eventreference-for-a-customeditor-without-a-serializedobject/23458 "2025-10-12T16:19:40Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![raxersound](https://avatars.discourse-cdn.com/v4/letter/r/4da419/32.png) [@raxersound](https://qa.fmod.com/u/raxersound)\
**Post date:** [October 12, 2025, 4:19pm UTC](https://qa.fmod.com/t/serialize-an-eventreference-for-a-customeditor-without-a-serializedobject/23458/1 "2025-10-12T16:19:40Z")

</div>

In my unity project I reached a point where I have a custom editor that requires specifically not to use a SerializedObject (in this case AdventureCreator’s custom Actions for ActionList).

I would love to add an EventReference but it is impossible since it requires a serializeObject or requires the field to be an object:

``  
`SerializedObject obj = new(this);`  
`SerializedProperty prop = obj.FindProperty("NameOfEventReference");`  
`EditorGUILayout.PropertyField(prop, "Reference"); // X this works but it uses serialized object`  
``

I though about EditorEventRef, but I can’t seem to find a way to transport that information outside a statement in Runtime. Basicaly, I would need to make use of that EditorEventRef in unity runtime.

How could I do that??

Edit: I’m using FMOD 2.03.06 and Unity 2022.3.30f1

---

<div class="post-metadata">

**Author:** ![raxersound](https://avatars.discourse-cdn.com/v4/letter/r/4da419/32.png) [@raxersound](https://qa.fmod.com/u/raxersound)\
**Post date:** [October 13, 2025, 4:50pm UTC](https://qa.fmod.com/t/serialize-an-eventreference-for-a-customeditor-without-a-serializedobject/23458/2 "2025-10-13T16:50:36Z")

</div>

Forget about the “EditorEventRef”, the point of the question is if it is possible to have an EventReference in a custom editor without using a serializedObject.

If you need more information about why I can’t use serializeObject, I can provide it if it makes any difference on the subject.

---

<div class="post-metadata">

**Author:** ![li\_fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/li_fmod/32/6577_2.png) [@li\_fmod](https://qa.fmod.com/u/li_fmod)\
**Post date:** [October 14, 2025, 1:14am UTC](https://qa.fmod.com/t/serialize-an-eventreference-for-a-customeditor-without-a-serializedobject/23458/3 "2025-10-14T01:14:22Z")

</div>

Hi,

Thank you for sharing the information!

> [@raxersound](#):
>
> How could I do that??

It sounds like [ScritableObject](https://docs.unity3d.com/6000.2/Documentation/Manual/class-ScriptableObject.html) might be what you are look for.

Instead of using the `SerializedObject`, you could store the `EventReference` inside a custom ScriptableObject, for example:

```auto
 public class FmodEventAsset : ScriptableObject
{
    public FMODUnity.EventReference reference;
}

```

Then, reference this ScriptableObject in your Action class (assuming it supports UnityEngine.Object references):

```auto
public class MyAcAction
{
    public FmodEventAsset eventAsset;

    public FMODUnity.EventReference ToEventReference()
    {
        return eventAsset != null ? eventAsset.reference : default;
    }
}

```

This way, you can still use FMOD’s event picker in the editor, and access the selected `EventReference` at runtime without relying on `SerializedObject`.

Hope this helps! Let me know if it works.

---

<div class="post-metadata">

**Author:** ![raxersound](https://avatars.discourse-cdn.com/v4/letter/r/4da419/32.png) [@raxersound](https://qa.fmod.com/u/raxersound)\
**Post date:** [October 14, 2025, 9:30am UTC](https://qa.fmod.com/t/serialize-an-eventreference-for-a-customeditor-without-a-serializedobject/23458/4 "2025-10-14T09:30:36Z")

</div>

Hello, thank you for your response!

This is a half solution because it does work, but it adds another extra layer to the process of adding an EventReference. This would be creating a ScriptableObject for each reference I want to asign instead of choosing it directly in the custom editor.

Isn’t there a way to reference directly the Custom Editor of EventReference?

Otherwise I guess the last solution would be asking you for the new feature on the next FMOD Unity update. Something like: “FMODUnityEditor.FMODEventReferenceField();”

Thank you for your attention!

---

<div class="post-metadata">

**Author:** ![li\_fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/li_fmod/32/6577_2.png) [@li\_fmod](https://qa.fmod.com/u/li_fmod)\
**Post date:** [October 15, 2025, 9:51pm UTC](https://qa.fmod.com/t/serialize-an-eventreference-for-a-customeditor-without-a-serializedobject/23458/5 "2025-10-15T21:51:22Z")

</div>

> [@raxersound](#):
>
> Isn’t there a way to reference directly the Custom Editor of EventReference?

As far as I know, there isn’t currently a way to directly reference the Custom Editor of `EventReference` without using a `SerializedObject`.

> [@raxersound](#):
>
> If you need more information about why I can’t use serializeObject, I can provide it if it makes any difference on the subject.

Since I am not familiar with the Adventure Creator plugin, could you please elaborate a bit more on why you can’t use serializeObject?

> [@raxersound](#):
>
> I though about EditorEventRef, but I can’t seem to find a way to transport that information outside a statement in Runtime. Basicaly, I would need to make use of that EditorEventRef in unity runtime.

If your workflow doesn’t necessarily rely on the event picker window, using the event path string could be a simpler alternative as [RuntimeManager.CreateInstance()](https://www.fmod.com/docs/2.03/unity/api-runtimemanager.html#createinstance) also accepts event paths (e.g. “event:/Music/Level1”), which can be stored and referenced at runtime.

---

<div class="post-metadata">

**Author:** ![raxersound](https://avatars.discourse-cdn.com/v4/letter/r/4da419/32.png) [@raxersound](https://qa.fmod.com/u/raxersound)\
**Post date:** [October 16, 2025, 6:47pm UTC](https://qa.fmod.com/t/serialize-an-eventreference-for-a-customeditor-without-a-serializedobject/23458/6 "2025-10-16T18:47:38Z")

</div>

> [@li\_fmod](#):
>
> Since I am not familiar with the Adventure Creator plugin, could you please elaborate a bit more on why you can’t use serializeObject?

AdventureCreator (forward as AC) is a 2D Point and Click Unity plugin that has a built-in node system, similar to the default unity’s animator. This AC node system is called “ActionList”, which contain different actions inside connected with nodes to make things happen in the game. ActionLists are a component you can place in a gameobject.

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/3/382e909cc4e2a95dda22b4d0d2328ad3933f99c0.jpeg)

This could be one ActionList with different actions inside (i searched one image in google).

AC allows you to create custom Actions (those windows) deriving from the AC class “AC.Action”, which derive from ScriptableObject primarily. It is like a “CustomEditor” but you are not provided with the parameters of a custom editor (serialized property, position, etc…), and even the same AC gives their own functions to generate each GUI that unity gives by default (Sliders, Toggles, Buttons…).

Given the nature of AC system colliding with unity’s serialization, it is very sensitive with serialized properties inside its own class, and as it is possible to serialize properties inside the Action class, it has some problems. One of it is reseting all the values of the whole Action when a SerializedProperty field is modified. This is because AC, for each modification, must “delete” and “recreate” the Action again (or that is what I assumed by extensive debug).

The only way to create a serialized object in an action is by:

```csharp
OnEnable()
{
    _serializedObject = new(this);
}

ShowGUI()
{
    var property = _serializedObject.FindProperty("EventReference");
    EditorGUILayout.PropertyField(property);
}

```

As you can see, if this Action is deleted and recreated, the serializedObject is renewed, making the whole object be 0. (Only for the parameters that use this serializedObject).

When I found out about this problem, I changed all the GUI I was displaying for the AC default functions or Unity’s GUI (the ones that doesn’t rely on serialized objects), and everything worked perfectly. But of course, EventReference isn’t something I can display without the use of a SerializedProperty.

> [@li\_fmod](#):
>
> If your workflow doesn’t necessarily rely on the event picker window, using the event path string could be a simpler alternative as [RuntimeManager.CreateInstance()](https://www.fmod.com/docs/2.03/unity/api-runtimemanager.html#createinstance) also accepts event paths (e.g. “event:/Music/Level1”), which can be stored and referenced at runtime.

I would love to rely on the original CustomEditor Event Picker from EventReference if possible, but if its not possible I can use the string method. It is a strange case, because the custom editor works and it displays correctly but when used then it resets.

---

<div class="post-metadata">

**Author:** ![li\_fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/li_fmod/32/6577_2.png) [@li\_fmod](https://qa.fmod.com/u/li_fmod)\
**Post date:** [October 21, 2025, 4:06am UTC](https://qa.fmod.com/t/serialize-an-eventreference-for-a-customeditor-without-a-serializedobject/23458/7 "2025-10-21T04:06:10Z")

</div>

Thank you for the detailed explanation, that really helps clarify the use case.

I’ve submitted a feature request to our dev team for further review, and will update you once there’s any progress to share.

---

<div class="post-metadata">

**Author:** ![raxersound](https://avatars.discourse-cdn.com/v4/letter/r/4da419/32.png) [@raxersound](https://qa.fmod.com/u/raxersound)\
**Post date:** [October 21, 2025, 6:10pm UTC](https://qa.fmod.com/t/serialize-an-eventreference-for-a-customeditor-without-a-serializedobject/23458/8 "2025-10-21T18:10:34Z")

</div>

Thank you for your attention and your williness to help me out, despite wether the feature request ends up in the next update or not!
