Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Bug The unity lnspector panel cannot display SerializeReference

Discussion in 'Editor & General Support' started by Yuze_75, Dec 14, 2022.

  1. Yuze_75

    Yuze_75

    Joined:
    Mar 14, 2022
    Posts:
    2
    I serialize an interface through SerializeReference in unity, but I cannot select the script of the class that inherits this interface in the lnspector panel What is this problem?
    I've tried two versions of 2021lts and 2020lts, but they don't work
     

    Attached Files:

  2. tomfulghum

    tomfulghum

    Joined:
    May 8, 2017
    Posts:
    69
    Unity can't serialize interfaces.
     
    Yuze_75 likes this.
  3. spiney199

    spiney199

    Joined:
    Feb 11, 2021
    Posts:
    6,015
    It can with SerializeReference and has been able to for a while.

    However it has no built in inspector support for it.

    Stupid, yes, I know.

    You're forced to use addons to use this rather powerful feature.
     
    Yuze_75 and tomfulghum like this.
  4. Yuze_75

    Yuze_75

    Joined:
    Mar 14, 2022
    Posts:
    2

    Yes, I found that I was wrong. I thought that the serialized reference could be displayed directly, but actually I saw that others could serialize the reference because they used the odin plug-in