29 lines
746 B
C#
29 lines
746 B
C#
|
using System;
|
|||
|
|
|||
|
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
|
|||
|
{
|
|||
|
MouseInput currentMouseInput { get; }
|
|||
|
void AddMouseInput(RayCastType rayCastType);
|
|||
|
}
|
|||
|
}
|