private void Awake() { for (int i = 0; i < shop.GetComponent <Shop>().slotItem.Length; i++) { int rng = Random.Range(0, allItemInGame.Count); objectToSell.Add(allItemInGame[rng]); } instance = this; }
void Awake() { if (instance != null && instance != this) { Destroy(this.gameObject); return; } else { instance = this; } DontDestroyOnLoad(this.gameObject); }