Added scene 4-Doggy
This commit is contained in:
@@ -15,7 +15,13 @@ public class MyButton : MonoBehaviour, IPointerClickHandler, IPointerEnterHandle
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
if (!TryGetComponent(out Collider2D _))
|
||||
{
|
||||
Debug.LogError("MyButton needs a Collider2D to work", gameObject);
|
||||
}
|
||||
|
||||
_outlineFx = GetComponent<OutlineFx.OutlineFx>();
|
||||
_outlineFx.enabled = false;
|
||||
}
|
||||
|
||||
public void OnPointerClick(PointerEventData eventData)
|
||||
|
||||
@@ -3,24 +3,13 @@ using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
|
||||
public class SwitchToScene : MonoBehaviour, IPointerClickHandler
|
||||
public class SwitchToScene : MonoBehaviour
|
||||
{
|
||||
[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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user