48 lines
1.1 KiB
C#
48 lines
1.1 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.EventSystems;
|
|
using UnityEngine.InputSystem;
|
|
using Object = UnityEngine.Object; // InputSystem 사용을 위해 추가
|
|
|
|
public abstract class BaseScene : MonoBehaviour
|
|
{
|
|
public Define.Scene _sceneType { get; protected set; } = Define.Scene.Uknown;
|
|
|
|
private void Start()
|
|
{
|
|
Init();
|
|
}
|
|
|
|
protected virtual void Init()
|
|
{
|
|
Object obj = FindFirstObjectByType<EventSystem>();
|
|
if (obj == null)
|
|
Manager.Resource.Instantiate("Prefabs/UI/EventSystem").name = "@EventSystem";
|
|
|
|
Manager.Input.InputAction -= Check;
|
|
Manager.Input.InputAction += Check;
|
|
}
|
|
|
|
private void Check(Define.InputEvent evt)
|
|
{
|
|
switch (evt)
|
|
{
|
|
case Define.InputEvent.Click:
|
|
Debug.Log($"Clicked Position:"); //{Manager.Input.LastPointPosition}");
|
|
break;
|
|
default:
|
|
Manager.Input.PointAction -= DebugLog;
|
|
break;
|
|
}
|
|
}
|
|
|
|
public void DebugLog(Vector2 vec)
|
|
{
|
|
Debug.Log(vec);
|
|
}
|
|
|
|
public abstract void Clear();
|
|
|
|
}
|