Dictionary issue, was requested to open this

Issue #699 resolved
Andreas Podgurski created an issue

In my game I have a dictionary with a scriptable object (InputEntity) as key a serializable class (ActionMapping). This worked - and works fine, but as I returned today to edit some data there, the inspector welcomed me with:

“Could not get a Unity SerializedProiperty for the property “Key” of type “InputDigital” at path “ActionMappings.{temp:0}#key”. Legacy Unity drawing compatibility is broken for this property; falling back to normal Odin drawing. Please report an issue on Odin’s issue tracker with details.”

InputDigital is derieved from InputEntity, ActionMappings is the name of the dictionary within the scriptable object “PlatformDeclaration”, Please let me know, what kind of additional information you need in this case, as it seems to be an expected issue to some degree.

Comments (7)

  1. Andreas Podgurski reporter

    Hi, I’m a bit sorry to hear no response. I’m having this issue with all my InputEntity-tables, which is a bummer, as this is a key coding scheme in my game. Don’t know, if this is of any help, but I attached a screenshot from another oocurrance.

    This makes the whole thing really hard to read and I fear to some extend to loose data at some point. Any ideas on this?

  2. Thomas Brown

    I’m also being faced with a similar issue.

    Here is the code that is generating the error.

    using System.Collections.Generic;
    using Sirenix.OdinInspector;
    using Sirenix.Serialization;
    using Sirenix.Utilities;
    using UnityEngine;
    
    namespace _Game_Assets.Scripts.Config
    {
        /// <summary>
        /// Maintains a list of global reference id's for Unity objects as well as various ref id helper functions
        /// </summary>
        [GameGlobalConfig]
        [ShowOdinSerializedPropertiesInInspector]
        public class GlobalRefIdService : GlobalConfig<GlobalRefIdService>, ISerializationCallbackReceiver
        {
            /// <summary>
            /// Maps a unique unity GameObject / Scriptable Object to a global reference id used for saving & loading.
            /// </summary>
            [Tooltip(
                "Maps a unique unity GameObject / Scriptable Object to a global reference id used for saving & loading.")]
            [DictionaryDrawerSettings(DisplayMode = DictionaryDisplayOptions.OneLine)]
            public Dictionary<UnityEngine.Object, long> references;
    
            #region Serialization
            [SerializeField, HideInInspector]
            private SerializationData serializationData;
    
            void ISerializationCallbackReceiver.OnAfterDeserialize()
            {
                UnitySerializationUtility.DeserializeUnityObject(this, ref this.serializationData);
            }
    
            void ISerializationCallbackReceiver.OnBeforeSerialize()
            {
                UnitySerializationUtility.SerializeUnityObject(this, ref this.serializationData);
            }
    
            public SerializationData SerializationData
            {
                get => serializationData;
                set => serializationData = value;
            }
    
            #endregion
        }
    }
    

    This error occurred on both Odin version 2.1.10 & 3.0.1

  3. Thomas Brown

    @Andreas Podgurski I have found that removing Peek Asset resolved my issue. Do you happen to have peek installed as well?

  4. Tor Esa Vestergaard
    • changed status to open

    I actually have a theory for why it might be failing in this one case, and there is a renewed possibility that we can fix it on Odin’s end; no timelines as to when I can get time to investigate the issue properly though, as we are quite busy at the moment.

  5. Andreas Podgurski reporter

    Can confirm, issue is fixed with 3.0.2, updating from 3.0.1. Thank you! 🙂

    Thomas, yes and no - I have Peek installed now (Great tool as well, an essential beside Odin), but that wasn’t the case, when I discovered the issue.

  6. Log in to comment