Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

EditorUtility.CopySerialized crashed Unity

Discussion in 'Scripting' started by FoxUmkov, Jun 3, 2011.

  1. FoxUmkov

    FoxUmkov

    Joined:
    Aug 31, 2009
    Posts:
    39
    Simply code:
    Code (csharp):
    1. GameObject so, de;
    2. ...
    3. if (GUILayout.Button("CopySerial"))
    4. {
    5.     if (so.GetComponent<BoxCollider>() != null  de.GetComponent<BoxCollider>() != null)
    6.         EditorUtility.CopySerialized(so.GetComponent<BoxCollider>(), de.GetComponent<BoxCollider>());
    7. }
    8. ...
    leads to crash.
    GameObjects so de is simple Default Cube's

    in EditorLog:
    "
    o == NULL
    UnityEditor.EditorUtility:CopySerialized(Object, Object)
    "

    Who met this?
     
  2. mgrenier

    mgrenier

    Joined:
    Apr 26, 2011
    Posts:
    57