Files
Fishing2/Assets/Scripts/Fishing2~/Common/CursorComponent.cs

104 lines
3.0 KiB
C#

// using Fantasy.Async;
// using Fantasy.Entitas;
// using Fantasy.Entitas.Interface;
// using Fantasy.Event;
// using NBC;
// using UnityEngine;
//
// namespace NBF.Fishing2
// {
// public class CursorUIShowEvent : AsyncEventSystem<UIShowEvent>
// {
// protected override async FTask Handler(UIShowEvent self)
// {
// var cursorComponent = App.Main.GetComponent<CursorComponent>();
// cursorComponent.UpdateCursor();
// }
// // protected override FTask Handler(UIShowEvent self)
// // {
// // throw new System.NotImplementedException();
// // }
// }
//
// public class CursorUIHideEvent : AsyncEventSystem<UIHideEvent>
// {
// protected override async FTask Handler(UIHideEvent self)
// {
// var cursorComponent = App.Main.GetComponent<CursorComponent>();
// cursorComponent.UpdateCursor();
// }
// }
//
// public class CursorComponent : Entity
// {
// #region System
//
//
//
// // public class CursorComponentAwakeSystem : AwakeSystem<CursorComponent>
// // {
// // protected override void Awake(CursorComponent self)
// // {
// //
// // }
// // }
// //
// // public class CursorComponentUpdateSystem : UpdateSystem<CursorComponent>
// // {
// // protected override void Update(CursorComponent self)
// // {
// // }
// // }
// //
// // public class CursorComponentDestroySystem : DestroySystem<CursorComponent>
// // {
// // protected override void Destroy(CursorComponent self)
// // {
// // }
// // }
//
// #endregion
//
// public void UpdateCursor()
// {
// bool showCursor = false;
// var uis = App.UI.GetAllUI();
// foreach (var ui in uis)
// {
// if (ui.IsShowing && ui.IsShowCursor)
// {
// showCursor = true;
// break;
// }
// }
//
// SetMouseCursor(showCursor);
// }
//
// public ControllerType controllerType = ControllerType.GamePad;
//
// public void SetMouseCursor(bool val)
// {
// Log.Info($"设置鼠标光标==={val}");
// if (val)
// {
// if (controllerType == ControllerType.KeyboardMouse)
// {
// Cursor.visible = true;
// }
//
// Cursor.lockState = CursorLockMode.None;
// }
// else if (controllerType == ControllerType.KeyboardMouse)
// {
// Cursor.visible = false;
// }
//
// Cursor.visible = val;
// if (!val)
// {
// Cursor.lockState = CursorLockMode.Confined;
// }
// }
// }
// }