Skip to content

Instantly share code, notes, and snippets.

@kamilion
Created November 25, 2015 02:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kamilion/c593492abc9f0674475d to your computer and use it in GitHub Desktop.
Save kamilion/c593492abc9f0674475d to your computer and use it in GitHub Desktop.
How to DontDestroyOnLoad in unity.
using UnityEngine;
namespace WarZone {
public class KeepThisAround : MonoBehaviour {
void Start() { Object.DontDestroyOnLoad(transform.root.gameObject); }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment