结构大修改,改成朴实无华的结构,不过度架构。能跑就行
This commit is contained in:
104
Assets/Scripts/Fishing2~/Common/CursorComponent.cs
Normal file
104
Assets/Scripts/Fishing2~/Common/CursorComponent.cs
Normal file
@@ -0,0 +1,104 @@
|
||||
// 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;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
Reference in New Issue
Block a user