Beispiel #1
0
 private void OnTriggerEnter2D(Collider2D other)
 {
     if (other.gameObject.tag == "Player")
     {
         rc.ChangeRoom(nextScene);
     }
 }
Beispiel #2
0
    // Called when a collision occurs
    private void OnTriggerEnter2D(Collider2D collision)
    {
        // Go to victory screen
        if (collision.gameObject.tag == "VictoryObject")
        {
            SceneManager.LoadScene("Victory");
        }

        // Pause on room change box
        if (collision.gameObject.tag == "RoomChangeBox")
        {
            Camera.main.GetComponent <RoomController>().ChangeRoom(path[path.Count - 1]);
        }

        // Pause on black hole into another room
        else if (collision.gameObject.tag == "BlackHole")
        {
            // If camera not in the same room
            if (roomController.GetRoomFromPoint(Camera.main.transform.position) != roomController.GetRoomFromPoint(transform.position))
            {
                // Change to new room
                roomController.ChangeRoom(transform.position);
            }
        }
    }
Beispiel #3
0
 private void Start()
 {
     _roomController = RoomController.Instance;
     if (!EditorMode)
     {
         _roomController.ChangeRoom("main", null);
     }
 }
 public void Action()
 {
     roomController.ChangeRoom(roomsDirections, transform);
     GameObject[] activeProjectiles;
     activeProjectiles = GameObject.FindGameObjectsWithTag("Projectile");
     foreach (GameObject projectile in activeProjectiles)
     {
         Destroy(projectile);
     }
 }