public override void Awake() { base.Awake(); if (Application.isPlaying) { GridlikePools.Initialize(); } }
/// <summary> /// Initialize the singleton. If necessary creates a GO to place the singleton on it. /// </summary> public static void Initialize() { if (_instance == null) { GameObject go = GameObject.Find("Gridlike"); if (go == null) { go = new GameObject("Gridlike"); } go.transform.position = Vector2.zero; _instance = go.AddComponent <GridlikePools> (); _instance._Initialize(); } }