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. Dismiss Notice

Bug [1331008] Inspector shows that the serialized object is drawn misplaced

Discussion in 'Editor & General Support' started by 479813005, Apr 22, 2021.

  1. 479813005

    479813005

    Joined:
    Mar 18, 2015
    Posts:
    58
    Inspector shows that the serialized object is drawn misplaced.
    if a serializable class "MyObject" have two list, and a monobehaviour hava a List<MyObject>,
    inspector on List<MyObject>'s elements will misplaced MyObject's two list.
    Snipaste_2021-04-22_20-44-12.png
     
  2. 479813005

    479813005

    Joined:
    Mar 18, 2015
    Posts:
    58
    TestScript

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using System;
    5.  
    6. public class Test : MonoBehaviour
    7. {
    8.     public List<MyObject> List1;
    9.     public List<MyObject2> List2;
    10. }
    11.  
    12. [Serializable]
    13. public class MyObject
    14. {
    15.     public List<int> List1;
    16.     public List<int> List2;
    17. }
    18.  
    19. [Serializable]
    20. public class MyObject2
    21. {
    22.     public List<int> List1;
    23. }
     

    Attached Files:

    • Test.cs
      File size:
      389 bytes
      Views:
      143