Frame/Assets/Scripts/RayCast/MouseInputManager.cs

28 lines
664 B
C#
Raw Normal View History

2024-04-08 18:20:55 +08:00
using System;
2024-04-07 17:20:48 +08:00
2024-04-08 18:20:55 +08:00
namespace Game.RayCast;
public class MouseInputManager : ManagerBase, IMouseInputManager
{
private MouseInput _currentMouseInput;
public MouseInput currentMouseInput => this._currentMouseInput;
protected override void OnInit()
{
base.OnInit();
AddMouseInput(RayCastType._2D);
}
public void AddMouseInput(RayCastType rayCastType)
{
_currentMouseInput ??= Game.self.AddComponent<MouseInput>();
this._currentMouseInput.rayCastType = rayCastType;
}
}
public interface IMouseInputManager
2024-04-07 17:20:48 +08:00
{
2024-04-08 18:20:55 +08:00
MouseInput currentMouseInput { get; }
void AddMouseInput(RayCastType rayCastType);
2024-04-07 17:20:48 +08:00
}