Skip to content

Instantly share code, notes, and snippets.

@lynxelia
Created February 10, 2018 02:21
Show Gist options
  • Save lynxelia/f2f72b6b8563428e08c44b6ebb416690 to your computer and use it in GitHub Desktop.
Save lynxelia/f2f72b6b8563428e08c44b6ebb416690 to your computer and use it in GitHub Desktop.
Example of a class that has an UnityEngine.Object field reference that will be garbage collected
public class ReferenceHolder : MonoBehaviour
{
public Sprite m_SpriteValue;
void OnDestroy()
{
m_SpriteValue = null;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment