using System.Collections; using System.Collections.Generic; using UnityEngine; public class DataManager : MonoBehaviour { static bool isAlready; void Awake() { GameObject[] pieces = GameObject.FindGameObjectsWithTag("Pieces"); if (isAlready) { Destroy(this.gameObject); } else { DontDestroyOnLoad(this.gameObject); isAlready = true; } } }