You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
550 B
27 lines
550 B
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.EventSystems;
|
|
|
|
public class SwitchToScene : MonoBehaviour, IPointerClickHandler
|
|
{
|
|
[SerializeField]
|
|
private SwitchableScene _scene;
|
|
|
|
[SerializeField]
|
|
private bool _triggerOnClick;
|
|
|
|
public void Switch()
|
|
{
|
|
SceneSwitcher.Instance.SwitchScene(_scene.index);
|
|
}
|
|
|
|
public void OnPointerClick(PointerEventData eventData)
|
|
{
|
|
Debug.Log("Click");
|
|
|
|
if (_triggerOnClick)
|
|
Switch();
|
|
}
|
|
}
|