26 lines
No EOL
755 B
C#
Executable file
26 lines
No EOL
755 B
C#
Executable file
using UnityEngine;
|
|
|
|
public class MANAGER_MANAGER_DATA_RoomSwitcher : MonoBehaviour
|
|
{
|
|
[Header("Куда летим")]
|
|
public Transform destination;
|
|
public Collider2D targetDATA_RoomBounds;
|
|
|
|
[Header("Музыка (оставь пустым, если менять не нужно)")]
|
|
public AudioClip newDATA_RoomMusic;
|
|
|
|
private void OnTriggerEnter2D(Collider2D other)
|
|
{
|
|
if (other.CompareTag("Player"))
|
|
{
|
|
|
|
if (newDATA_RoomMusic != null)
|
|
{
|
|
MANAGER_Music.Instance.SwitchMusic(newDATA_RoomMusic);
|
|
}
|
|
|
|
|
|
MANAGER_DATA_RoomTransition.Instance.Travel(other.gameObject, destination.position, targetDATA_RoomBounds);
|
|
}
|
|
}
|
|
} |