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