Skip to content

Instantly share code, notes, and snippets.

@smkplus
Last active April 16, 2020 06:54
Show Gist options
  • Save smkplus/3af8fd9b3316edcaa68c78d06c1e030f to your computer and use it in GitHub Desktop.
Save smkplus/3af8fd9b3316edcaa68c78d06c1e030f to your computer and use it in GitHub Desktop.
using UnityEngine;
public class SomePerson : MonoBehaviour
{
//This field gets serialized because it is public.
public string firstName = "John";
//This field does not get serialized because it is private.
private int age = 40;
//This field gets serialized even though it is private
//because it has the SerializeField attribute applied.
[SerializeField]
private bool hasHealthPotion = true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment