[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.mzph.cn/bicheng/59536.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

你们要的App电量分析测试来了

Batterystats 是包含在 Android 框架中的一种工具&#xff0c;用于收集设备上的电池数据。您可以使用 adb 将收集的电池数据转储到开发计算机&#xff0c;并创建一份可使用 Battery Historian 分析的报告。Battery Historian 会将报告从 Batterystats 转换为可在浏览器中查看的…

<项目代码>YOLOv8 学生课堂行为识别<目标检测

YOLOv8是一种单阶段&#xff08;one-stage&#xff09;检测算法&#xff0c;它将目标检测问题转化为一个回归问题&#xff0c;能够在一次前向传播过程中同时完成目标的分类和定位任务。相较于两阶段检测算法&#xff08;如Faster R-CNN&#xff09;&#xff0c;YOLOv8具有更高的…

智慧水肥一体化:道品科技现代农业的智能管理模式

智慧水肥一体化是现代农业中一种重要的管理模式&#xff0c;它通过信息技术和物联网技术的结合&#xff0c;实现对水资源和肥料的智能化管理。这一系统的主要功能包括环境监测、集中管理、智能控制、主动报警和数据管理。以下将分别对这些功能进行详细阐述&#xff0c;并探讨智…

ES入门:查询和聚合

安装完ElasticSearch 和 Kibana后我们开始学习 为了方便测试&#xff0c;使用kibana的dev tool来进行学习测试&#xff1a; 测试工具 从索引文档开始 插入 向 Elasticsearch 索引 customer 的 _doc 类型的文档 id 为 1 的文档发送 PUT 请求的例子。 请求体为 JSON 格式&am…

Docker Remote API TLS 认证_docker远程接口未授权访问漏洞怎么解决

漏洞描述&#xff1a; Docker Remote API 是一个取代远程命令行界面的REST API&#xff0c;其默认绑定2375端口&#xff0c;如管理员对其配置不当可导致未授权访问漏洞。攻击者利用docker client或者http直接请求就可以访问这个API&#xff0c;可导致敏感信息泄露&#xff0c;…

华为eNSP:QinQ

一、什么是QinQ&#xff1f; QinQ是一种网络技术&#xff0c;全称为"Quantum Insertion"&#xff0c;也被称为"Q-in-Q"、"Double Tagging"或"VLAN stacking"。它是一种在现有的VLAN&#xff08;Virtual Local Area Network&#xff0…

利用SCF文件构建网络渗透

SMB是一种广泛用于企业组织中文件共享目的的网络协议。在内部的渗透测试中&#xff0c;发现包含明文密码和数据库连接字符串等敏感信息的共享文件并不罕见。但是&#xff0c;即使一个文件共享不包含任何可用于连接到其他系统的数据&#xff0c;但是未经身份验证的用户配置拥有该…

陀螺仪BMI323驱动开发测试(基于HAL库SPI通信)

参考资料 编写代码 读取芯片ID void BMI160_Init(void) {uint16_t chipID BMI323_read(BMI160_REG_CHIP_ID);debug("BMI323芯片ID为0x%x;", chipID);if (chipID ! 0x43){debug("未检测到BMI323;");}elsedebug("检测到陀螺仪BMI323;");u8 buf_…

基于vue框架的的流浪宠物救助系统25128(程序+源码+数据库+调试部署+开发环境)系统界面在最后面。

系统程序文件列表 项目功能&#xff1a;用户,宠物类别,领养中心,领养申请,云投喂,申请入驻,义工入驻 开题报告内容 基于Vue框架的流浪宠物救助系统开题报告 一、项目背景 近年来&#xff0c;随着城市化进程的加速&#xff0c;流浪动物问题日益凸显。它们面临着食物短缺、疾…

Python | Leetcode Python题解之第541题反转字符串II

题目&#xff1a; 题解&#xff1a; class Solution:def reverseStr(self, s: str, k: int) -> str:t list(s)for i in range(0, len(t), 2 * k):t[i: i k] reversed(t[i: i k])return "".join(t)

机器学习2_支持向量机_线性可分——MOOC

目录 定义 线性可分&#xff08;Linear Separable&#xff09; 线性不可分&#xff08;Nonlinear Separable&#xff09; 数学化定义 问题描述 优化问题 线性可分定义 假定训练样本集是线性可分的 1、最小化&#xff08;Minimize&#xff09;&#xff1a; 2、限制条件…

Java基础-Java中的常用类(上)

(创作不易&#xff0c;感谢有你&#xff0c;你的支持&#xff0c;就是我前行的最大动力&#xff0c;如果看完对你有帮助&#xff0c;请留下您的足迹&#xff09; 目录 String类 创建字符串 字符串长度 连接字符串 创建格式化字符串 String 方法 System类 常用方法 方…

基于TRIZ理论的便携式光伏手机充电装置创新

随着智能手机功能的日益强大&#xff0c;电量消耗问题也日益凸显&#xff0c;尤其是在户外活动时&#xff0c;电量告急常常让人措手不及。面对这一挑战&#xff0c;基于TRIZ&#xff08;发明问题解决理论&#xff09;的创新思维&#xff0c;一款全新的便携式光伏手机充电装置应…

Django目录结构最佳实践

Django项目目录结构 项目目录结构配置文件引用修改创建自定义子应用方法修改自定义注册目录从apps目录开始 项目目录结构 └── backend # 后端项目目录&#xff08;项目名称&#xff09;├── __init__.py├── logs # 项目日志目录├── manage.py #…

《今日制造与升级》是什么级别的期刊?是正规期刊吗?能评职称吗?

​问题解答 问&#xff1a;《今日制造与升级》是不是核心期刊&#xff1f; 答&#xff1a;不是&#xff0c;是知网收录的正规学术期刊。 问&#xff1a;《今日制造与升级》级别&#xff1f; 答&#xff1a;国家级。主管单位&#xff1a;中国机械工业联合会 …

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

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

人工智能技术:未来生活的“魔法师”

想象一下&#xff0c;未来的某一天&#xff0c;你醒来时&#xff0c;智能助手已经为你准备好了早餐&#xff0c;你的智能家居系统根据你的心情和日程安排调整了室内的光线和音乐&#xff0c;而你的自动驾驶汽车已经在门口等你。这不是科幻小说&#xff0c;这是人工智能技术为我…

排序(用java实现)

排序 排序的概念及引用排序的概念常见的排序算法 常见排序算法的实现插入排序基本思想&#xff1a;直接插入排序希尔排序(缩小增量排序) 选择排序基本思想&#xff1a;直接选择排序堆排序 交换排序冒泡排序快速排序快速排序的优化快速排序非递归 归并排序基本思想归并排序归并排…

(C++回溯算法)微信小程序“开局托儿所”游戏

问题描述 给定一个矩阵 A ( a i j ) m n \bm A(a_{ij})_{m\times n} A(aij​)mn​&#xff0c;其中 a i j ∈ { 1 , 2 , ⋯ , 9 } a_{ij}\in\{1,2,\cdots,9\} aij​∈{1,2,⋯,9}&#xff0c;且满足 ∑ i 1 m ∑ j 1 n a i j \sum\limits_{i1}^m\sum\limits_{j1}^na_{ij} i…

数字IC后端实现之Innovus Place跑完density爆涨案例分析

下图所示为咱们社区a7core后端训练营学员的floorplan。 数字IC后端实现 | Innovus各个阶段常用命令汇总 该学员跑placement前density是59.467%&#xff0c;但跑完place后density飙升到87.68%。 仔细查看place过程中的log就可以发现Density一路飙升&#xff01; 数字IC后端物…