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

Question about [SerializeField]s

Discussion in 'EditorXR' started by jimjahan, Apr 14, 2017.

  1. jimjahan

    jimjahan

    Joined:
    Feb 13, 2015
    Posts:
    13
    How and when the [SerializeField]s are loaded or deserialized? For example in CreatePrimitiveTools.cs, how m_MenuPrefab is initialized with correct CreatePrimitiveMenu?
     
  2. amirebrahimi_unity

    amirebrahimi_unity

    Unity Technologies

    Joined:
    Aug 12, 2015
    Posts:
    400
    You assign these fields to the script itself in the inspector. Select CreatePrimitiveTool.cs and you'll see that you can set defaults for fields.
     
  3. jimjahan

    jimjahan

    Joined:
    Feb 13, 2015
    Posts:
    13
    Wonderful! Thanks!