OneShotOneKill/Assets/Script/UGUI/Common/GameUI.cs

25 lines
719 B
C#
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using UnityEngine;
public class GameUI : MonoBehaviourSingletonTemplate<GameUI>
{
public Camera m_UICamera;
private void Update()
{
if (Input.GetMouseButtonDown(0))
{
// 1⃣ 마우스 위치(화면 좌표)
Vector3 mousePos = Input.mousePosition;
// 2⃣ UI 카메라 기준의 월드 좌표로 변환
Vector3 worldPos = m_UICamera.ScreenToWorldPoint(mousePos);
// 3⃣ Z값 고정 (UI 평면 상)
worldPos.z = 0f;
// 4⃣ 이펙트 생성
//if (EffectMgr.Ins && EffectMgr.Ins.LoadComplete)
// EffectMgr.Ins.Show_Effect("TouchEffect", worldPos);
}
}
}