[Unity Demo]从零开始制作空洞骑士Hollow Knight第十八集补充:制作空洞骑士独有的EventSystem和InputModule

提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档

文章目录

  • 前言
  • 一、制作空洞骑士独有的EventSystem和InputModule
  • 总结


前言

        hello大家好久没见,之所以隔了这么久才更新并不是因为我又放弃了这个项目,而是接下来要制作的工作太忙碌了,每次我都花了很长的时间解决完一个部分,然后就没力气打开CSDN写文章就直接睡觉去了,现在终于有时间整理下我这半个月都做了什么内容。

       那么这一期的标题是什么意思呢?就是我之前漏讲了UI当中非常关键的EventSystem和InputModule,没有这两个组件Unity的UI是不会自动进行UI的导航,点击后的事件啥的,而你创建一个canvas,unity会自动生成了一个eventsystem,但是Input Module则是绑定的是Unity最传统的Input Manager,如果你用过前两三年前unity推出的input system的话,你知道它们是要求你替换到input system独有的input module的,

        既然我们是使用插件InControl来作为输入控制,我们也要生成一个空洞骑士独有的UI输入木块。

一、pandas是什么?

        首先来创建一个类名字叫HollowKnightInputModule.cs,然后它的代码逻辑整体是根据UnityEngine.EventSystems里面的StandaloneInputModule.cs来写的,如果不了解的话建议先了解一下unity自带的input module的源码。

        

using System;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.Serialization;namespace InControl
{[AddComponentMenu("Event/Hollow Knight Input Module")]public class HollowKnightInputModule : StandaloneInputModule{public HeroActions heroActions;public PlayerAction SubmitAction {get{return InputHandler.Instance.inputActions.menuSubmit;}set{}}public PlayerAction CancelAction {get{return InputHandler.Instance.inputActions.menuCancel;}set{}}public PlayerAction JumpAction {get{return InputHandler.Instance.inputActions.jump;}set{}}public PlayerAction CastAction {get{return InputHandler.Instance.inputActions.cast;}set{}}public PlayerAction AttackAction {get{return InputHandler.Instance.inputActions.attack;}set{}}public PlayerTwoAxisAction MoveAction {get{return InputHandler.Instance.inputActions.moveVector;}set{}}[Range(0.1f, 0.9f)]public float analogMoveThreshold = 0.5f;public float moveRepeatFirstDuration = 0.8f;public float moveRepeatDelayDuration = 0.1f;[FormerlySerializedAs("allowMobileDevice")]public new bool forceModuleActive;public bool allowMouseInput = true;public bool focusOnMouseHover;private InputDevice inputDevice;private Vector3 thisMousePosition;private Vector3 lastMousePosition;private Vector2 thisVectorState;private Vector2 lastVectorState;private float nextMoveRepeatTime;private float lastVectorPressedTime;private TwoAxisInputControl direction;public HollowKnightInputModule(){heroActions = new HeroActions();direction = new TwoAxisInputControl();direction.StateThreshold = analogMoveThreshold;}public override void UpdateModule(){lastMousePosition = thisMousePosition;thisMousePosition = Input.mousePosition;}public override bool IsModuleSupported(){return forceModuleActive || Input.mousePresent;}public override bool ShouldActivateModule(){if (!enabled || !gameObject.activeInHierarchy){return false;}UpdateInputState();bool flag = false;flag |= SubmitAction.WasPressed;flag |= CancelAction.WasPressed;flag |= JumpAction.WasPressed;flag |= CastAction.WasPressed;flag |= AttackAction.WasPressed;flag |= VectorWasPressed;if (allowMouseInput){flag |= MouseHasMoved;flag |= MouseButtonIsPressed;}if (Input.touchCount > 0){flag = true;}return flag;}public override void ActivateModule(){base.ActivateModule();thisMousePosition = Input.mousePosition;lastMousePosition = Input.mousePosition;GameObject gameObject = eventSystem.currentSelectedGameObject;if (gameObject == null){gameObject = eventSystem.firstSelectedGameObject;}eventSystem.SetSelectedGameObject(gameObject, GetBaseEventData());}public override void Process(){bool flag = SendUpdateEventToSelectedObject();if (eventSystem.sendNavigationEvents){if (!flag){flag = SendVectorEventToSelectedObject();}if (!flag){SendButtonEventToSelectedObject();}}if (allowMouseInput){ProcessMouseEvent();}}private bool SendButtonEventToSelectedObject(){if (eventSystem.currentSelectedGameObject == null){return false;}if (UIManager.instance.IsFadingMenu){return false;}BaseEventData baseEventData = GetBaseEventData();Platform.MenuActions menuAction = Platform.Current.GetMenuAction(SubmitAction.WasPressed, CancelAction.WasPressed, JumpAction.WasPressed, AttackAction.WasPressed, CastAction.WasPressed);if (menuAction == Platform.MenuActions.Submit){ExecuteEvents.Execute<ISubmitHandler>(eventSystem.currentSelectedGameObject, baseEventData, ExecuteEvents.submitHandler);}else if (menuAction == Platform.MenuActions.Cancel){PlayerAction playerAction = AttackAction.WasPressed ? AttackAction : CastAction;if (!playerAction.WasPressed || playerAction.FindBinding(new MouseBindingSource(Mouse.LeftButton)) == null){ExecuteEvents.Execute<ICancelHandler>(eventSystem.currentSelectedGameObject, baseEventData, ExecuteEvents.cancelHandler);}}return baseEventData.used;}private bool SendVectorEventToSelectedObject(){if (!VectorWasPressed){return false;}AxisEventData axisEventData = GetAxisEventData(thisVectorState.x, thisVectorState.y, 0.5f);if (axisEventData.moveDir != MoveDirection.None){if (eventSystem.currentSelectedGameObject == null){eventSystem.SetSelectedGameObject(eventSystem.firstSelectedGameObject, GetBaseEventData());}else{ExecuteEvents.Execute(eventSystem.currentSelectedGameObject, axisEventData, ExecuteEvents.moveHandler);}SetVectorRepeatTimer();}return axisEventData.used;}protected override void ProcessMove(PointerEventData pointerEvent){GameObject pointerEnter = pointerEvent.pointerEnter;base.ProcessMove(pointerEvent);if (focusOnMouseHover && pointerEnter != pointerEvent.pointerEnter){GameObject eventHandler = ExecuteEvents.GetEventHandler<ISelectHandler>(pointerEvent.pointerEnter);eventSystem.SetSelectedGameObject(eventHandler, pointerEvent);}}private void Update(){direction.Filter(Device.Direction, Time.deltaTime);}private void UpdateInputState(){lastVectorState = thisVectorState;thisVectorState = Vector2.zero;TwoAxisInputControl twoAxisInputControl = MoveAction ?? direction;if (Utility.AbsoluteIsOverThreshold(twoAxisInputControl.X, analogMoveThreshold)){thisVectorState.x = Mathf.Sign(twoAxisInputControl.X);}if (Utility.AbsoluteIsOverThreshold(twoAxisInputControl.Y, analogMoveThreshold)){thisVectorState.y = Mathf.Sign(twoAxisInputControl.Y);}if (VectorIsReleased){nextMoveRepeatTime = 0f;}if (VectorIsPressed){if (lastVectorState == Vector2.zero){if (Time.realtimeSinceStartup > lastVectorPressedTime + 0.1f){nextMoveRepeatTime = Time.realtimeSinceStartup + moveRepeatFirstDuration;}else{nextMoveRepeatTime = Time.realtimeSinceStartup + moveRepeatDelayDuration;}}lastVectorPressedTime = Time.realtimeSinceStartup;}}public InputDevice Device{get{return inputDevice ?? InputManager.ActiveDevice;}set{inputDevice = value;}}private void SetVectorRepeatTimer(){nextMoveRepeatTime = Mathf.Max(nextMoveRepeatTime, Time.realtimeSinceStartup + moveRepeatDelayDuration);}private bool VectorIsPressed{get{return thisVectorState != Vector2.zero;}}private bool VectorIsReleased{get{return thisVectorState == Vector2.zero;}}private bool VectorHasChanged{get{return thisVectorState != lastVectorState;}}private bool VectorWasPressed{get{return (VectorIsPressed && Time.realtimeSinceStartup > nextMoveRepeatTime) || (VectorIsPressed && lastVectorState == Vector2.zero);}}private bool MouseHasMoved{get{return (thisMousePosition - lastMousePosition).sqrMagnitude > 0f;}}private bool MouseButtonIsPressed{get{return Input.GetMouseButtonDown(0);}}}
}

这里涉及到我们InputActions.cs和InputHandler.cs代码相关的:

我们先来到HeroActions.cs,创建好menuUI的按键输入:

using System;
using InControl;public class HeroActions : PlayerActionSet
{public PlayerAction left;public PlayerAction right;public PlayerAction up;public PlayerAction down;public PlayerAction menuSubmit;public PlayerAction menuCancel;public PlayerTwoAxisAction moveVector;public PlayerAction attack;public PlayerAction jump;public PlayerAction dash;public PlayerAction cast;public PlayerAction focus;public PlayerAction quickCast;public PlayerAction openInventory;public HeroActions(){menuSubmit = CreatePlayerAction("Submit");menuCancel = CreatePlayerAction("Cancel");left = CreatePlayerAction("Left");left.StateThreshold = 0.3f;right = CreatePlayerAction("Right");right.StateThreshold = 0.3f;up = CreatePlayerAction("Up");up.StateThreshold = 0.3f;down = CreatePlayerAction("Down");down.StateThreshold = 0.3f;moveVector = CreateTwoAxisPlayerAction(left, right, down, up);moveVector.LowerDeadZone = 0.15f;moveVector.UpperDeadZone = 0.95f;attack = CreatePlayerAction("Attack");jump = CreatePlayerAction("Jump");dash = CreatePlayerAction("Dash");cast = CreatePlayerAction("Cast");focus = CreatePlayerAction("Focus");quickCast = CreatePlayerAction("QuickCast");openInventory = CreatePlayerAction("Inventory");}
}

来到InputHandler.cs当中,我们要做的功能如下,首先当然是添加新的按键绑定AddKeyBinding,还有添加新的默认绑定AddDefaultBinding,特别是我们新建的两个行为PlayerAction的menuCancel和menuSubmit

  private void MapKeyboardLayoutFromGameSettings(){AddKeyBinding(inputActions.menuSubmit, "Return");AddKeyBinding(inputActions.menuCancel, "Escape");AddKeyBinding(inputActions.up, "UpArrow");AddKeyBinding(inputActions.down, "DownArrow");AddKeyBinding(inputActions.left, "LeftArrow");AddKeyBinding(inputActions.right, "RightArrow");AddKeyBinding(inputActions.attack, "Z");AddKeyBinding(inputActions.jump, "X");AddKeyBinding(inputActions.dash, "D");AddKeyBinding(inputActions.cast, "F");AddKeyBinding(inputActions.quickCast, "Q");AddKeyBinding(inputActions.openInventory, "I");}private void SetupNonMappableBindings(){inputActions = new HeroActions();inputActions.menuSubmit.AddDefaultBinding(new Key[]{Key.Return});inputActions.menuCancel.AddDefaultBinding(new Key[]{Key.Escape});inputActions.up.AddDefaultBinding(new Key[]{Key.UpArrow});inputActions.down.AddDefaultBinding(new Key[]{Key.DownArrow});inputActions.left.AddDefaultBinding(new Key[]{Key.LeftArrow});inputActions.right.AddDefaultBinding(new Key[]{Key.RightArrow});inputActions.attack.AddDefaultBinding(new Key[]{Key.Z});inputActions.jump.AddDefaultBinding(new Key[]{Key.X});inputActions.dash.AddDefaultBinding(new Key[]{Key.D});inputActions.cast.AddDefaultBinding(new Key[]{Key.F});inputActions.quickCast.AddDefaultBinding(new Key[]{Key.Q});inputActions.openInventory.AddDefaultBinding(new Key[]{Key.I});}private static void AddKeyBinding(PlayerAction action, string savedBinding){Mouse mouse = Mouse.None;Key key;if (!Enum.TryParse(savedBinding, out key) && !Enum.TryParse(savedBinding, out mouse)){return;}if (mouse != Mouse.None){action.AddBinding(new MouseBindingSource(mouse));return;}action.AddBinding(new KeyBindingSource(new Key[]{key}));}

还有就是解决上期忘记讲到的两套Input输入一个是游戏内的输入,一个是过场的输入,当在过场UI阶段,我们就使用过场的输入,屏蔽游戏内的输入,然后是决定UI界面的输入和停止UI界面的输入,完整的代码如下:

using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine.UI;
using GlobalEnums;
using InControl;
using UnityEngine;
using UnityEngine.EventSystems;public class InputHandler : MonoBehaviour
{[SerializeField] public bool pauseAllowed { get; private set; }public bool acceptingInput = true;public bool skippingCutscene;private float skipCooldownTime;private bool isGameplayScene;private bool isMenuScene;public static InputHandler Instance;private GameManager gm;private PlayerData playerData;public InputDevice gameController;public HeroActions inputActions;public BindingSourceType lastActiveController;public InputDeviceStyle lastInputDeviceStyle;public delegate void CursorVisibilityChange(bool isVisible); //指针显示变化时发生的委托public event CursorVisibilityChange OnCursorVisibilityChange;//指针显示变化时发生的事件public bool readyToSkipCutscene;public SkipPromptMode skipMode { get; private set; }public delegate void ActiveControllerSwitch();public event ActiveControllerSwitch RefreshActiveControllerEvent;public void Awake(){Instance = this;gm = GetComponent<GameManager>();inputActions = new HeroActions();acceptingInput = true;pauseAllowed = true;skipMode = SkipPromptMode.NOT_SKIPPABLE;}public void Start(){playerData = gm.playerData;SetupNonMappableBindings();MapKeyboardLayoutFromGameSettings();if(InputManager.ActiveDevice != null && InputManager.ActiveDevice.IsAttached){}else{gameController = InputDevice.Null;}Debug.LogFormat("Input Device set to {0}.", new object[]{gameController.Name});lastActiveController = BindingSourceType.None;}private void Update(){UpdateActiveController();if (acceptingInput){if(gm.gameState == GameState.PLAYING){PlayingInput();}else if(gm.gameState == GameState.CUTSCENE){CutSceneInput();}}}public void UpdateActiveController(){if (lastActiveController != inputActions.LastInputType || lastInputDeviceStyle != inputActions.LastDeviceStyle){lastActiveController = inputActions.LastInputType;lastInputDeviceStyle = inputActions.LastDeviceStyle;if (RefreshActiveControllerEvent != null){RefreshActiveControllerEvent();}}}private void PlayingInput(){}private void CutSceneInput(){if (!Input.anyKeyDown && !gameController.AnyButton.WasPressed){return;}if (skippingCutscene){return;}switch (skipMode){case SkipPromptMode.SKIP_PROMPT: //确认跳过过场if (!readyToSkipCutscene){//TODO:gm.ui.ShowCutscenePrompt(CinematicSkipPopup.Texts.Skip);readyToSkipCutscene = true;CancelInvoke("StopCutsceneInput");Invoke("StopCutsceneInput", 5f * Time.timeScale);skipCooldownTime = Time.time + 0.3f;return;}if(Time.time < skipCooldownTime){return;}CancelInvoke("StopCutsceneInput");readyToSkipCutscene = false;skippingCutscene = true;gm.SkipCutscene();return;case SkipPromptMode.SKIP_INSTANT://立刻跳过过场skippingCutscene = true;gm.SkipCutscene();return;case SkipPromptMode.NOT_SKIPPABLE: //不准跳过过场return;case SkipPromptMode.NOT_SKIPPABLE_DUE_TO_LOADING: //在过场视频加载的时候不准跳过过场gm.ui.ShowCutscenePrompt(CinematicSkipPopup.Texts.Skip);CancelInvoke("StopCutsceneInput");Invoke("StopCutsceneInput", 5f * Time.timeScale);break;default:return;}}private void StopCutsceneInput(){readyToSkipCutscene = false;gm.ui.HideCutscenePrompt();}private void MapKeyboardLayoutFromGameSettings(){AddKeyBinding(inputActions.menuSubmit, "Return");AddKeyBinding(inputActions.menuCancel, "Escape");AddKeyBinding(inputActions.up, "UpArrow");AddKeyBinding(inputActions.down, "DownArrow");AddKeyBinding(inputActions.left, "LeftArrow");AddKeyBinding(inputActions.right, "RightArrow");AddKeyBinding(inputActions.attack, "Z");AddKeyBinding(inputActions.jump, "X");AddKeyBinding(inputActions.dash, "D");AddKeyBinding(inputActions.cast, "F");AddKeyBinding(inputActions.quickCast, "Q");AddKeyBinding(inputActions.openInventory, "I");}private void SetupNonMappableBindings(){inputActions = new HeroActions();inputActions.menuSubmit.AddDefaultBinding(new Key[]{Key.Return});inputActions.menuCancel.AddDefaultBinding(new Key[]{Key.Escape});inputActions.up.AddDefaultBinding(new Key[]{Key.UpArrow});inputActions.down.AddDefaultBinding(new Key[]{Key.DownArrow});inputActions.left.AddDefaultBinding(new Key[]{Key.LeftArrow});inputActions.right.AddDefaultBinding(new Key[]{Key.RightArrow});inputActions.attack.AddDefaultBinding(new Key[]{Key.Z});inputActions.jump.AddDefaultBinding(new Key[]{Key.X});inputActions.dash.AddDefaultBinding(new Key[]{Key.D});inputActions.cast.AddDefaultBinding(new Key[]{Key.F});inputActions.quickCast.AddDefaultBinding(new Key[]{Key.Q});inputActions.openInventory.AddDefaultBinding(new Key[]{Key.I});}private static void AddKeyBinding(PlayerAction action, string savedBinding){Mouse mouse = Mouse.None;Key key;if (!Enum.TryParse(savedBinding, out key) && !Enum.TryParse(savedBinding, out mouse)){return;}if (mouse != Mouse.None){action.AddBinding(new MouseBindingSource(mouse));return;}action.AddBinding(new KeyBindingSource(new Key[]{key}));}public void SceneInit(){if (gm.IsGameplayScene()){isGameplayScene = true;}else{isGameplayScene = false;}if (gm.IsMenuScene()){isMenuScene = true;}else{isMenuScene = false;}}public void SetSkipMode(SkipPromptMode newMode){Debug.Log("Setting skip mode: " + newMode.ToString());if (newMode == SkipPromptMode.NOT_SKIPPABLE){StopAcceptingInput();}else if (newMode == SkipPromptMode.SKIP_PROMPT){readyToSkipCutscene = false;StartAcceptingInput();}else if (newMode == SkipPromptMode.SKIP_INSTANT){StartAcceptingInput();}else if (newMode == SkipPromptMode.NOT_SKIPPABLE_DUE_TO_LOADING){readyToSkipCutscene = false;StartAcceptingInput();}skipMode = newMode;}public void StopUIInput(){acceptingInput = false;EventSystem.current.sendNavigationEvents = false;UIManager.instance.inputModule.allowMouseInput = false;}public void StartUIInput(){acceptingInput = true;EventSystem.current.sendNavigationEvents = true;UIManager.instance.inputModule.allowMouseInput = true;}public void StopMouseInput(){UIManager.instance.inputModule.allowMouseInput = false;}public void StartMouseInput(){UIManager.instance.inputModule.allowMouseInput = true;}public void PreventPause(){}public void StopAcceptingInput(){acceptingInput = false;}public void StartAcceptingInput(){acceptingInput = true;}public void AllowPause(){pauseAllowed = true;}}

回到编辑器当中,我们来给UIManager的EventSystem添加上这两个脚本:


总结

        OK大功告成,这期算是对前两期的补充内容了,如果你在前两期遇到bug的话可以在这里找下解决办法。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.xdnf.cn/news/4050.html

如若内容造成侵权/违法违规/事实不符,请联系一条长河网进行投诉反馈,一经查实,立即删除!

相关文章

capl语言

capl:事件型语言 定时器代码 数据类型 capl运算符&#xff08;一&#xff09; capl运算符&#xff08;二&#xff09; 逻辑非&#xff1a;两个条件同时成立则为真&#xff08;1&#xff09;&#xff0c;否则为假&#xff08;0&#xff09;. 逻辑与&#xff1a;只有一个条件…

[渲染层网络层错误] net::ERR_CONTENT_LENGTH_MISMATCH 问题解决

问题描述 问题背景 微信小程序访问后端img资源的时候&#xff0c;偶尔出现这个感叹号&#xff0c;图片加载不出来&#xff0c;但是对应的url贴出来在浏览器中访问&#xff0c;或者重新加载是可以访问的。 错误描述 经查询前端报错 [渲染层网络层错误] net::ERR_CONTENT_LE…

跳蚤市场之商品发布功能

一 商品类别和小类的联动 以下是一个示例代码&#xff0c;展示了如何实现商品类别中大类和小类的联动。 商品大类选择框、小类选择框 的设计 html部分 <form id"category-form"><label for"major-category">大类&#xff1a;</label&g…

LabVIEW气体检测系统

随着工业化进程的加速&#xff0c;环境污染问题愈加严峻&#xff0c;尤其是有害气体的排放对人类生存环境构成了严重威胁。为了更好地监测这些有害气体&#xff0c;开发一个高效、准确且易于操作的气体检测系统显得尤为重要。LabVIEW软件开发的气体检测系统&#xff0c;采用激光…

【三维重建】Semantic Gaussians:开放词汇的3DGS场景理解

文章目录 摘要一、引言二、主要方法1.3D Gaussian Splatting2.其他方法2.1 Gaussian Grouping2.2 GARField 3. 2D Versatile 投影4. 3D Semantic Network4. 推理 四、实验1. 实验设置2.定量结果 论文&#xff1a;https://arxiv.org/pdf/2403.15624 摘要 开放词汇的三维场景理解…

机器学习—前向传播的一般实现

可以写一个函数来实现一个密集的层&#xff0c;那是神经网络的单层&#xff0c;所以定义稠密函数&#xff0c;它将上一层的激活作为输入以及给定层神经元的参数w和b。看下边图片所展示的例子&#xff0c;把所有这些权重向量堆叠成一个矩阵&#xff0c;wnp.array([[1,-3,5][2,4,…

Java实验六 网络和数据库

1. 利用InetAddress编写程序接受用户输入网址&#xff0c;输出这个网址的主机IP地址。 package project; import java.net.InetAddress; import java.net.UnknownHostException; import java.util.Scanner; public class GetIPAddress {public static void main(String[] args…

猎板PCB2到10层数的科技进阶与应用解析

1. 单层板&#xff08;Single-sided PCB&#xff09; 定义&#xff1a;单层板是最基本的PCB类型&#xff0c;导线只出现在其中一面&#xff0c;因此被称为单面板。限制&#xff1a;由于只有一面可以布线&#xff0c;设计线路上有许多限制&#xff0c;不适合复杂电路。应用&…

分布式任务调度实现原理

目录 分布式任务调度功能 分布式任务调度实现 1.Scheduler&#xff08;调度器&#xff09; 2.Trigger&#xff08;触发器&#xff09; 3.Job&#xff08;任务&#xff09; 分布式任务调度框架 xxl-job quartz Snail Job PowerJob elastic-job 分布式任务调度功能 通…

qt QFontDialog详解

1、概述 QFontDialog 是 Qt 框架中的一个对话框类&#xff0c;用于选择字体。它提供了一个可视化的界面&#xff0c;允许用户选择所需的字体以及相关的属性&#xff0c;如字体样式、大小、粗细等。用户可以通过对话框中的选项进行选择&#xff0c;并实时预览所选字体的效果。Q…

qt QStandardItem详解

1、概述 QStandardItem是Qt框架中QStandardItemModel的一个基础元素&#xff0c;用于在基于项的模型&#xff08;如QStandardItemModel&#xff09;中表示单个数据项。QStandardItem可以存储文本、图标、工具提示等丰富的信息&#xff0c;并且支持数据的编辑和自定义显示。通过…

【每日一题】LeetCode - 最接近的三数之和

LeetCode 的「最接近的三数之和」问题要求我们从给定整数数组中找到三个数的和&#xff0c;使它最接近目标值。适合初学者的原因在于它结合了双指针、排序等基本技巧&#xff0c;为大家理解基本的算法和数据结构提供了一个很好的机会。 如果你不知道什么是双指针可以参考我之前…

【青牛科技】GC8549替代LV8549/ONSEMI在摇头机、舞台灯、打印机和白色家电等产品上的应用分析

引言 在现代电子产品中&#xff0c;控制芯片的性能直接影响到设备的功能和用户体验。摇头机、舞台灯、打印机和白色家电等领域对控制精度、功耗和成本等方面的要求日益提高。LV8549/ONSEMI等国际品牌的芯片曾是这些产品的主要选择&#xff0c;但随着国内半导体技术的进步&…

教育机构如何利用知识中台进行数字教学

在教育行业&#xff0c;数字化转型已成为提升教学质量和效率的关键。知识中台作为一种新兴的技术平台&#xff0c;为教育机构提供了一个集中化、智能化的知识管理和应用解决方案。本文将探讨教育机构如何利用知识中台进行数字教学&#xff0c;以及这一转型带来的优势。 1. 知识…

项目审核系统 ---(连接数据库---项目模拟)

本章主要是查询方法和修改方法 编写查询方法&#xff0c;查询所有项目审核信息并返回查询结果&#xff0c;需实现分页功能&#xff0c;注意必要的异常处理。编写查询方法&#xff0c;根据项目编号查询指定项目的审核信息&#xff0c;注意必要的异常处理。编写修改方法&#xf…

C语言 | Leetcode C语言题解之第524题通过删除字母匹配到字典里最长单词

题目&#xff1a; 题解&#xff1a; char * findLongestWord(char * s, char ** d, int dSize){char *result "";int max -1;for (int i 0; i < dSize; i) {char *p s, *q d[i];int j 0, k 0;while (p[j] ! \0 && q[k] ! \0) {if (p[j] q[k]) {k…

Git详细使用

本地项目托管到码云中教程 1. 使用git init 命令&#xff0c;git init命令用于在目录中创建新的 Git 仓库。 在目录中执行git init就可以创建一个 Git 仓库了。 2. 使用git status命令查看未提交的文件 3. 使用git add . 命令将所有文件添加到暂存区 4. 使用git commit -m &qu…

开源办公软件 ONLYOFFICE 深入探索

文章目录 引言1. ONLYOFFICE 创建的背景1. 1 ONLYOFFICE 项目启动1. 2 ONLYOFFICE 的发展历程 2. 核心功能介绍2. 1 桌面编辑器2. 1. 1 文档2. 1. 2 表格2. 1. 3 幻灯片 2. 2 协作空间2. 3 文档编辑器 - 本地部署版 3. 技术介绍4. 安装5. 优势与挑战6. 个人体验7. 强大但不止于…

Day95 Docker

Docker的使用 1、Docker是什么 docker是一个用来管理镜像的容器 容器(container)&#xff1a;可以装东西 镜像( image )&#xff1a;所谓的镜像&#xff0c;你可以认为就是一个虚拟机 虚拟机&#xff1a;用软件代理硬件来模拟整个计算机的这样一套软件就成为 虚拟机 镜像说白了…

WPF中如何简单的使用CommunityToolkit.Mvvm创建一个项目并进行 增删改查

目录 开始前准备的数据库dbblog如下&#xff1a; 第一步&#xff1a;创建项目后下载四个NuGet程序包 第二步&#xff1a;删除原本的MainWindow.XAML文件 并创建如下的目录结构 然后在View文件夹下面创建Login.XAML和Main.XAML 并且在App.XAML中将启动项改为Login.XA…