Added scene 4-Doggy

This commit is contained in:
cblech
2025-01-04 14:14:49 +01:00
parent 22f67f4347
commit e36314851a
11 changed files with 721 additions and 16 deletions
+6
View File
@@ -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)
+1 -12
View File
@@ -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();
}
}