private void OnTriggerEnter2D(Collider2D collision) { if (collision.CompareTag("Player")) { Debug.Log("player detected"); TempSave.savePlayer(); sceneController.LoadScene(toScene); } }
void Awake() { if (_instance == null) { _instance = this; } slots = GameObject.FindGameObjectsWithTag("Slot"); tempPos = new Vector3[slots.Length]; tempBool = new bool[slots.Length]; }
private void Awake() { // if the singleton hasn't been initialized yet if (instance != null && instance != this) { Destroy(this.gameObject); return;//Avoid doing anything else } instance = this; }