Search Unity

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

    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!