スポンサーリンク
シングルトンの書き方をよく忘れてしまうので自分メモ。
public class HogeManager : MonoBehaviour { public static HogeManager instance; private void Awake() { if (instance != null && instance != this) { Destroy(this.gameObject); return; } instance = this; //DontDestroyOnLoad(gameObject); DontDestroyOnLoad使うかは、ものによる } }