Esempio n. 1
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.CompareTag("Player"))
     {
         Debug.Log("player detected");
         TempSave.savePlayer();
         sceneController.LoadScene(toScene);
     }
 }
Esempio n. 2
0
 void Awake()
 {
     if (_instance == null)
     {
         _instance = this;
     }
     slots    = GameObject.FindGameObjectsWithTag("Slot");
     tempPos  = new Vector3[slots.Length];
     tempBool = new bool[slots.Length];
 }
Esempio n. 3
0
    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;
    }