Created
December 18, 2022 02:10
-
-
Save gekidoslair/e35decb1431a83cf56c48b524abbf51d to your computer and use it in GitHub Desktop.
Simple component that sets the don't destroy on load property for the game object it is attached to
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
public class DontDestroyOnLoad : MonoBehaviour | |
{ | |
// Start is called before the first frame update | |
void Start() | |
{ | |
DontDestroyOnLoad(this); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment