当前位置: 首页 > news >正文

Unity 通用UI界面逻辑总结

概述

在游戏开发中,常常会遇到一些通用的界面逻辑,它不论在什么类型的游戏中都会出现。为了避免重复造轮子,本文总结并提供了一些常用UI界面的实现逻辑。希望可以帮助大家快速开发通用界面模块,也可以在次基础上进行扩展修改,以适应你项目的需求。

工程链接:GitCode - 全球开发者的开源社区,开源代码托管平台

二次确认界面

using UnityEngine;
using UnityEngine.Events;
using UnityEngine.UI;public class ConfirmDialog : MonoBehaviour
{private Text txt_title;private Text txt_content;private Button btn_Yes;private Button btn_No;void Start(){var root = gameObject.transform;txt_title = root.Find("txt_Title").GetComponent<Text>();txt_content = root.Find("txt_Content").GetComponent<Text>();btn_Yes = root.Find("btn/btn_Yes").GetComponent<Button>();btn_No = root.Find("btn/btn_No").GetComponent<Button>();txt_title.text = "提示";//测试代码InitDialog("好好学习,天天向上!", () => {Debug.Log("Yes"); },() => {Debug.Log("No"); });}/// <summary>/// 重载一:使用默认标题 “提示”/// </summary>/// <param name="content">需要确认的内容</param>/// <param name="yesAction">确认按钮回调</param>/// <param name="noAction">取消按钮回调</param>public void InitDialog(string content, UnityAction yesAction = null, UnityAction noAction = null){txt_title.text = "提示";CoreLogic(content, yesAction, noAction);}/// <summary>/// 重载一:使用自定义标题/// </summary>/// <param name="title">自定义标题</param>/// <param name="content">需要确认的内容</param>/// <param name="yesAction">确认按钮回调</param>/// <param name="noAction">取消按钮回调</param>public void InitDialog(string title, string content, UnityAction yesAction = null, UnityAction noAction = null){txt_title.text = title;CoreLogic(content, yesAction, noAction);}//公共逻辑提取private void CoreLogic(string content, UnityAction yesAction = null, UnityAction noAction = null){txt_content.text = content;BindBtnLogic(btn_Yes, yesAction);BindBtnLogic(btn_No, noAction);btn_Yes.gameObject.SetActive(yesAction != null);btn_No.gameObject.SetActive(noAction != null);}//绑定按钮点击回调private void BindBtnLogic(Button btn, UnityAction action){btn.onClick.RemoveAllListeners();if (action != null){btn.onClick.AddListener(action);}}
}

切页标签

通过按钮来实现。虽然使用Toggle也可以实现,但是在实际开发中会发现使用toggle不好控制选中事件的触发和选中状态表现。通过按钮来自定义组件可以更好地控制逻辑的调用和标签的显示。

using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.UI;class TabNode
{ public int index;public GameObject offBg;public GameObject onBg;public Text offTxt;public Text onTxt;public Button btn;public UnityAction callback;
}public class SwitchPageTab : MonoBehaviour
{public Transform tabRoot;//标签组的父节点public GameObject tabObj;//标签页预制体模板private int _selectIndex;//选中的标签页索引private List<TabNode> _objList = new List<TabNode>();private Dictionary<int, UnityAction> _callbackDic = new Dictionary<int, UnityAction>();private void Start(){_selectIndex = -1;InitCount(4);BindSelectCallback(0, "背包", (() =>{Debug.Log("查看背包");}));BindSelectCallback(1, "英雄", (() =>{Debug.Log("查看英雄");}));BindSelectCallback(2, "商店", (() =>{Debug.Log("查看商店");}));BindSelectCallback(3, "活动", (() =>{Debug.Log("查看活动");}));OnSelectLogic(0);}/// <summary>/// 初始化调用/// </summary>/// <param name="count">标签的数量</param>public void InitCount(int count){_objList.Clear();ClearAllChild(tabRoot);for (var i = 0; i < count; i++){var obj = Instantiate(tabObj, tabRoot);obj.SetActive(true);var trans = obj.transform;var node = new TabNode{offTxt = trans.Find("btn/offBg/offTxt").GetComponent<Text>(),onTxt = trans.Find("btn/onBg/onTxt").GetComponent<Text>(),onBg = trans.Find("btn/onBg").gameObject,offBg = trans.Find("btn/offBg").gameObject,btn = trans.Find("btn").GetComponent<Button>(),};var index = i;BindBtnLogic(node.btn, () =>{OnSelectLogic(index);});_objList.Add(node);}}/// <summary>/// 绑定指定页签索引的回调函数/// </summary>/// <param name="index">页签索引</param>/// <param name="txt">页签问本</param>/// <param name="callback">选中回调</param>public void BindSelectCallback(int index,string txt,UnityAction callback){if (_callbackDic.ContainsKey(index)){Debug.LogError("已经注册过了!");return;}if (callback == null){Debug.LogError("回调为空!");return;}if (index < 0 || index > _objList.Count){Debug.LogError("索引越界!");return;}var node = _objList[index];node.onTxt.text = txt;node.offTxt.text = txt;_callbackDic.Add(index,callback);}/// <summary>/// 调用指定索引对应的回调函数/// </summary>/// <param name="index"></param>private void OnSelectLogic(int index){if (index == _selectIndex){return;}_selectIndex = index;var isExist = _callbackDic.TryGetValue(_selectIndex, out UnityAction callback);if (isExist){callback?.Invoke();SetSelectStatus(index);}}/// <summary>/// 控制指定页签的UI表现/// </summary>/// <param name="index"></param>private void SetSelectStatus(int index){var count = _objList.Count;for (var i = 0; i < count; i++){var isActive = index == i;var node = _objList[i];node.onBg.SetActive(isActive);node.offBg.SetActive(!isActive);}}//清除指定父节点下的所有子物体private void ClearAllChild(Transform parentRoot){var childCount = parentRoot.childCount;for (var i = childCount - 1; i >= 0; i--){var child = parentRoot.GetChild(i);DestroyImmediate(child.gameObject);}}//绑定按钮点击回调private void BindBtnLogic(Button btn, UnityAction action){btn.onClick.RemoveAllListeners();if (action != null){btn.onClick.AddListener(action);}}
}

飘字提示

简易版本

using UnityEngine;
using UnityEngine.Pool;
using DG.Tweening;
using UnityEngine.UI;public class SimpleTip : MonoBehaviour
{//提示栏预制体public GameObject tipObj;//提示栏显示的父节点public Transform tipRoot;//对象池private ObjectPool<GameObject> tipPool;//飞行高度private float flyHeight = 500;void Start(){InitTipPool();}void Update(){if (Input.GetKeyDown(KeyCode.Space)){ShowTip("货币不足!");}}void ShowTip(string tipStr){var obj = tipPool.Get();var rectValue = obj.GetComponent<RectTransform>();var group = obj.GetComponent<CanvasGroup>();var txt = obj.transform.Find("txt").GetComponent<Text>();txt.text = tipStr;obj.SetActive(true);group.alpha = 1;ResetLocal(obj.transform);rectValue.DOAnchorPosY(flyHeight, 1f).OnComplete(() =>{group.DOFade(0, 0.1f).OnComplete(() =>{tipPool.Release(obj);});});}//初始化对象池void InitTipPool(){tipPool = new ObjectPool<GameObject>(() =>{//创建新对象调用var obj = Instantiate(tipObj, tipRoot);obj.SetActive(false);return obj;},(go) =>{//获取对象调用go.SetActive(true);ResetLocal(go.transform);},(go) =>{// 在对象放回池子时调用go.SetActive(false);ResetLocal(go.transform);go.transform.SetParent(tipRoot);},(go) =>{Destroy(go); });}//重置本地信息void ResetLocal(Transform trans){trans.localPosition = Vector3.zero;trans.localEulerAngles = Vector3.zero;trans.localScale = Vector3.one;}
}

升级版本

using System.Collections.Generic;
using DG.Tweening;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.Pool;public class GoodTip : MonoBehaviour
{//提示栏显示的父节点public Transform root;//提示栏模板预制体public GameObject tipObj;//对象池节点public Transform objectPool;//最多显示的提示栏数量,超过就隐藏private int limitCount = 5;//提示栏之间的偏移private float offset = 20;//提示飞行高度private float flyHeight = 100;//提示栏生成数量,只用于逻辑运算private int tipCount = 0;//提示栏高度private float tipHeight;private Queue<GameObject> visualTipQueue = new Queue<GameObject>();//是否可继续生成提示栏,防止频繁点击造成异常private bool isOk = true;private float timer = 0f;private bool startTimer = false;private float displayTime = 0.65f;//提示停留展示时间private ObjectPool<GameObject> tipPool;void Start(){var rect = tipObj.GetComponent<RectTransform>();tipHeight = rect.rect.height;InitTipPool();}private void Update(){if (startTimer){//定时统一清理提示消息timer += Time.deltaTime;if (timer > displayTime){ClearAllMsg();timer = 0f;startTimer = false;}}if (Input.GetKeyDown(KeyCode.Space)){ShowTip("货币不足!");}}public void ShowTip(string tip){if (!isOk){return;}startTimer = false;isOk = false;var obj = tipPool.Get();var rect1 = obj.GetComponent<RectTransform>();var group = obj.GetComponent<CanvasGroup>();var sequence = DOTween.Sequence();if (visualTipQueue.Count > 0){sequence.AppendCallback(() =>{foreach (var item in visualTipQueue){var rectValue = item.GetComponent<RectTransform>();rectValue.DOAnchorPosY(rectValue.anchoredPosition.y+tipHeight+offset, 0.2f);}});sequence.AppendInterval(0.2f);}sequence.AppendCallback(() =>{group.alpha = 1;obj.transform.SetParent(root);obj.transform.localScale = new Vector3(0, 0, 1);obj.SetActive(true);rect1.anchoredPosition = Vector2.zero;visualTipQueue.Enqueue(obj);tipCount++;var txt  = obj.transform.Find("txt").GetComponent<Text>();txt.text = tip;if (tipCount > limitCount){var result = visualTipQueue.Dequeue();tipPool.Release(result);tipCount--;}});sequence.Append(obj.transform.DOScale(Vector3.one, 0.1f));sequence.AppendInterval(0.1f);sequence.OnComplete(() =>{timer = 0f;isOk = true;startTimer = true;});}//初始化对象池void InitTipPool(){tipPool = new ObjectPool<GameObject>(() =>{//创建新对象调用var obj = Instantiate(tipObj, objectPool);obj.SetActive(false);return obj;},(go) =>{//获取对象调用go.SetActive(true);ResetLocal(go.transform);},(go) =>{// 在对象放回池子时调用go.SetActive(false);ResetLocal(go.transform);go.transform.SetParent(objectPool);},(go) =>{Destroy(go); });}//重置本地信息void ResetLocal(Transform trans){trans.localPosition = Vector3.zero;trans.localEulerAngles = Vector3.zero;trans.localScale = Vector3.one;}//清空消息public void ClearAllMsg(){var childCount = root.childCount;for (var i = 0; i < childCount; i++){var child = root.GetChild(i);var group = child.GetComponent<CanvasGroup>();var rectValue = child.GetComponent<RectTransform>();var sequence = DOTween.Sequence();sequence.AppendInterval(0.1f * i);sequence.Append(rectValue.DOAnchorPosY(rectValue.anchoredPosition.y + tipHeight+flyHeight, 0.2f));sequence.Append(group.DOFade(0, 0.1f).OnComplete(() =>{visualTipQueue.Dequeue();tipPool.Release(child.gameObject);tipCount--;}));}}
}

                                                                                      

左右切换按钮组

本组件一般出现在查看英雄界面,点击左右两个按钮切换查看按钮的详细信息。在英雄列表中,第一个英雄的左按钮不显示,最后一个英雄的右按钮不显示。

using UnityEngine;
using UnityEngine.Events;
using UnityEngine.UI;public class SwitchCheck : MonoBehaviour
{public Button btn_Left;public Button btn_Right;public Text txt_Check;private int sumCount;private int curIndex;private UnityAction<int> callback;//外部逻辑回调void Start(){curIndex = 0;InitGroup(10, (index) =>{txt_Check.text = $"{index}/{sumCount}";});CheckBtnActive();BindBtnLogic(btn_Left, () =>{var nextIndex = curIndex - 1;if (nextIndex < 0){return;}curIndex = nextIndex;CheckBtnActive();});BindBtnLogic(btn_Right, () =>{var nextIndex = curIndex + 1;if (nextIndex >= sumCount){return;}curIndex = nextIndex;CheckBtnActive();});}public void InitGroup(int _sumCount,UnityAction<int> _callback){sumCount = _sumCount;callback = _callback;}//按钮显隐逻辑private void CheckBtnActive(){if (sumCount <= 1){btn_Left.gameObject.SetActive(false);btn_Right.gameObject.SetActive(false);}else{btn_Left.gameObject.SetActive(curIndex >= 1);btn_Right.gameObject.SetActive(curIndex <= sumCount-2);}var showIndex = curIndex + 1;callback?.Invoke(showIndex);}//绑定按钮点击回调private void BindBtnLogic(Button btn, UnityAction action){btn.onClick.RemoveAllListeners();if (action != null){btn.onClick.AddListener(action);}}
}

帮助说明界面

using System.Text;
using UnityEngine;
using UnityEngine.UI;public class ComDesc : MonoBehaviour
{public Text txt_Title;public Text txt_Desc;public RectTransform content;void Update(){if (Input.GetKeyDown(KeyCode.Space)){SetDesc("帮助", "好好学习,天天向上");}if (Input.GetKeyDown(KeyCode.A)){var str = "好好学习,天天向上";StringBuilder sb = new StringBuilder();for (var i = 1; i < 100; i++){sb.Append(str);}SetDesc("帮助", sb.ToString());}}/// <summary>/// 设置说明描述/// </summary>/// <param name="title">界面标题</param>/// <param name="desc">说明文本</param>public void SetDesc(string title,string desc){txt_Title.text = title;txt_Desc.text = desc;LayoutRebuilder.ForceRebuildLayoutImmediate(content);}
}

跑马灯消息提示

有消息队列缓存,等待队列中所有消息播放完后,提示才消失。

using System.Collections.Generic;
using DG.Tweening;
using UnityEngine;
using TMPro;
using UnityEngine.Events;
using UnityEngine.UI;public class Marquee : MonoBehaviour
{public TMP_Text tmpTxt;public RectTransform maskNode;public CanvasGroup canvasGroup;private float maskWidth;private float unitTime = 0.2f;//计算动画时间自定义标准private Queue<MsgNode> marqueeMsg = new Queue<MsgNode>();private List<int> idList = new List<int>();private bool isPlay;//是否正在播放消息private class MsgNode{public int id;public string msg;public int loopCount;}void Start(){maskWidth = maskNode.rect.width;}// Update is called once per framevoid Update(){if (Input.GetKeyDown(KeyCode.Space)){var id = Random.Range(1,100);var str = $"id:{id}好好学习,天天向上>>";AddMarqueeMsg(id,str,1);}if(marqueeMsg.Count > 0) {if (!isPlay){isPlay = true;tmpTxt.rectTransform.anchoredPosition = Vector2.zero;var data = marqueeMsg.Peek();idList.Remove(data.id);DisplayMarqueeMsg(data.msg,data.loopCount, () =>{marqueeMsg.Dequeue();if (marqueeMsg.Count == 0){canvasGroup.alpha = 0;}isPlay = false;});}}}/// <summary>/// 在跑马灯消息队列中添加消息/// </summary>/// <param name="msgId">消息记录的唯一id</param>/// <param name="msg">消息内容</param>/// <param name="loopCount">循环播放时间</param>public void AddMarqueeMsg(int msgId, string msg, int loopCount){if (idList.Contains(msgId)){Debug.LogError("消息已在预播队列");return;}if (canvasGroup.alpha < 0.95f){canvasGroup.alpha = 1;}idList.Add(msgId);marqueeMsg.Enqueue(new MsgNode{id = msgId,msg = msg,loopCount = loopCount});}/// <summary>/// 跑马灯消息播放/// </summary>/// <param name="msgId">消息记录的唯一id</param>/// <param name="msg">消息内容</param>/// <param name="loopCount">循环播放时间</param>public void DisplayMarqueeMsg(string msg,int loopCount,UnityAction callback){tmpTxt.text = msg;LayoutRebuilder.ForceRebuildLayoutImmediate(tmpTxt.rectTransform);var width = tmpTxt.rectTransform.rect.width+maskWidth;var duration = GetDuration(width);tmpTxt.rectTransform.DOAnchorPosX(-width, duration).SetEase(Ease.Linear).SetLoops(loopCount, LoopType.Restart).OnComplete(() =>{callback?.Invoke();});}//根据消息长度计算动画匀速运行时间private float GetDuration(float width){var offset1 = (int)width / 100;var offset2 = width % 100 == 0 ?0:1;var offset = offset1 + offset2;return offset * unitTime;}
}

相关文章:

Unity 通用UI界面逻辑总结

概述 在游戏开发中&#xff0c;常常会遇到一些通用的界面逻辑&#xff0c;它不论在什么类型的游戏中都会出现。为了避免重复造轮子&#xff0c;本文总结并提供了一些常用UI界面的实现逻辑。希望可以帮助大家快速开发通用界面模块&#xff0c;也可以在次基础上进行扩展修改&…...

Python3 与 VSCode:深度对比分析

Python3 与 VSCode:深度对比分析 引言 Python3 和 Visual Studio Code(VSCode)在软件开发领域扮演着举足轻重的角色。Python3 作为一门强大的编程语言,拥有丰富的库和框架,广泛应用于数据科学、人工智能、网络开发等多个领域。而 VSCode 作为一款轻量级且功能强大的代码…...

第五课:Express框架与RESTful API设计:技术实践与探索

在使用Node.js进行企业应用开发&#xff0c;常用的开发框架Express&#xff0c;其中的中间件、路由配置与参数解析、RESTful API核心技术尤为重要&#xff0c;本文将深入探讨它们在应用开发中的具体使用方法&#xff0c;最后通过Postman来对开发的接口进行测试。 一、Express中…...

Linux 内核自定义协议族开发:从 “No buffer space available“ 错误到解决方案

引言 在 Linux 内核网络协议栈开发中,自定义协议族(Address Family, AF)是实现新型通信协议或扩展内核功能的关键步骤。然而,开发者常因对内核地址族管理机制理解不足,遇到如 insmod: No buffer space available 的错误。本文将以实际案例为基础,深入分析错误根源,并提…...

html-列表标签和表单标签

一、列表标签 表格是用来显示数据的,那么列表就是用来布局的 列表最大的特点就是整齐&#xff64;整洁&#xff64;有序,它作为布局会更加自由和方便&#xff61; 根据使用情景不同,列表可以分为三大类:无序列表&#xff64;有序列表和自定义列表&#xff61; 1.无序列表(重…...

HTML-网页介绍

一、网页 1.什么是网页&#xff1a; 网站是指在因特网上根据一定的规则&#xff0c;使用 HTML 等制作的用于展示特定内容相关的网页集合。 网页是网站中的一“页”&#xff0c;通常是 HTML 格式的文件&#xff0c;它要通过浏览器来阅读。 网页是构成网站的基本元素&#xf…...

动态ip和静态ip适用于哪个场景?有何区别

在数字化浪潮席卷全球的今天&#xff0c;IP地址作为网络世界的“门牌号”&#xff0c;其重要性不言而喻。然而&#xff0c;面对动态IP与静态IP这两种截然不同的IP分配方式&#xff0c;许多用户往往感到困惑&#xff1a;它们究竟有何区别&#xff1f;又分别适用于哪些场景呢&…...

android13打基础: 保存用户免得下次重新登录逻辑

使用SP来做 创建LoginUser.kt // 登录用户需要Email data class LoginUser(val email: String,val password: String, )创建假数据FakeLoginUser.kt object FakeLoginUser {val fake_login_user_items arrayListOf(LoginUser(email "1690544550qq.com",password …...

Linux 4.4 内核源码的目录结构及其主要内容的介绍

以下是 Linux 4.4 内核源码的目录结构及其主要内容的介绍,适用于理解内核模块和驱动开发的基本框架: Linux 4.4 内核源码目录结构 目录作用与内容arch/平台架构相关代码每个子目录对应一种 CPU 架构(如 x86/、arm/、arm64/),包含硬件相关的启动逻辑、中断处理、内存管理等…...

手脑革命:拆解Manus AI如何用“执行智能体”重构生产力——中国团队突破硅谷未竟的技术深水区

第一章&#xff1a;Manus AI 的技术演进与行业背景 1.1 从工具到智能体&#xff1a;AI 技术的范式跃迁 人工智能的发展经历了从规则驱动&#xff08;Rule-based&#xff09;到统计学习&#xff08;Statistical Learning&#xff09;&#xff0c;再到深度学习&#xff08;Deep…...

Android 调用c++报错 exception of type std::bad_alloc: std::bad_alloc

一、报错信息 terminating with uncaught exception of type std::bad_alloc: std::bad_alloc 查了那部分报错c++代码 szGridSize因为文件太大,初始化溢出了 pEGM->pData = new float[szGridSize]; 解决办法 直接抛出异常,文件太大就失败吧 最后还增加一个日志输出,给…...

匿名GitHub链接使用教程(Anonymous GitHub)2025

Anonymous GitHub 1. 引言2. 准备3. 进入Anonymous GitHub官网4. 用GitHub登录匿名GitHub并授权5. 进入个人中心&#xff0c;然后点击• Anonymize Repo实例化6. 输入你的GitHub链接7. 填写匿名链接的基础信息8. 提交9. 实例化对应匿名GitHub链接10. 进入个人中心管理项目11. 查…...

【0基础跟AI学软考高项】成本管理

&#x1f4b0;「成本管理」是什么&#xff1f;‌ ‌一句话解释‌&#xff1a;像家庭装修控制预算&#xff0c;既要买得起好材料&#xff0c;又要避免超支吃泡面——成本管理就是精准算钱、合理花钱、动态盯钱&#xff0c;保证项目不破产&#xff01; &#x1f30b; ‌真实案例…...

模型的原始输出为什么叫 logits

模型的原始输出为什么叫 logits flyfish 一、Logarithm&#xff08;对数 log&#xff09; 定义&#xff1a;对数是指数运算的逆运算&#xff0c;表示某个数在某个底数下的指数。 公式&#xff1a;若 b x a b^x a bxa&#xff0c;则 log ⁡ b ( a ) x \log_b(a) x logb…...

[SAP MM] 查看物料主数据的物料类型

创建物料主数据时&#xff0c;必须为物料分配物料类型&#xff0c;如原材料或半成品 在标准系统中&#xff0c;物料类型ROH(原材料)的所有物料都要从外部采购&#xff0c;而类型为NLAG(非库存物料)的物料则可从外部采购也可在内部生产 ① 特殊物料类型&#xff1a;NLAG 该物料…...

风控模型算法面试题集结

特征处理 1. 特征工程的一般步骤什么?什么是特征迭代 特征工程一般包含: 数据获取,分析数据的可用性(覆盖率,准确率,获取容易程度)数据探索,分析数据业务含义,对特征有一个大致了解,同时进行数据质量校验,包含缺失值、异常值和一致性等;特征处理,包含数据处理和…...

PX4中的DroneCAN的实现库Libuavcan及基础功能示例

简介 Libuavcan是一个用C编写的可移植的跨平台库&#xff0c;对C标准库的依赖小。它可以由几乎任何符合标准的C编译器编译&#xff0c;并且可以在几乎任何体系结构/OS上使用。 在 DroneCAN 中&#xff0c;Libuavcan 有一个 DSDL 编译器&#xff0c;将 DSDL 文件转换为 hpp 头…...

Hot 3D 人体姿态估计 HPE Demo复现过程

视频讲解 Hot 3D 人体姿态估计 HPE Demo复现过程 标题&#xff1a;Hourglass Tokenizer for Efficient Transformer-Based 3D Human Pose Estimation论文地址&#xff1a;https://arxiv.org/abs/2311.12028代码地址&#xff1a;https://github.com/NationalGAILab/HoT 使用con…...

Linux操作系统6- 线程1(线程基础,调用接口,线程优缺点)

上篇文章&#xff1a;Linux操作系统5- 补充知识&#xff08;可重入函数&#xff0c;volatile关键字&#xff0c;SIGCHLD信号&#xff09;-CSDN博客 本篇Gitee仓库&#xff1a;myLerningCode/l27 橘子真甜/Linux操作系统与网络编程学习 - 码云 - 开源中国 (gitee.com) 目录 一.…...

每周一个网络安全相关工具——MetaSpLoit

一、Metasploit简介 Metasploit&#xff08;MSF&#xff09;是一款开源渗透测试框架&#xff0c;集成了漏洞利用、Payload生成、后渗透模块等功能&#xff0c;支持多种操作系统和硬件平台。其模块化设计&#xff08;如exploits、auxiliary、payloads等&#xff09;使其成为全球…...

MAC-禁止百度网盘自动升级更新

通过终端禁用更新服务(推荐)​ 此方法直接移除百度网盘的自动更新组件,无需修改系统文件。 ​步骤: ​1.关闭百度网盘后台进程 按下 Command + Space → 输入「活动监视器」→ 搜索 BaiduNetdisk 或 UpdateAgent → 结束相关进程。 ​2.删除自动更新配置文件 打开终端…...

【C语言】自定义类型:结构体,联合,枚举(上)

前言&#xff1a;在C语言中除了我们经常使用的数据(int&#xff0c;float&#xff0c;double类型)等这些类型以外&#xff0c;还有一种类型就是自定义类型&#xff0c;它包括结构体&#xff0c;联合体&#xff0c;枚举类型。为什么要有这种自定义类型呢&#xff1f;假设我们想描…...

SQLiteStudio:一款免费跨平台的SQLite管理工具

SQLiteStudio 是一款专门用于管理和操作 SQLite 数据库的免费工具。它提供直观的图形化界面&#xff0c;简化了数据库的创建、编辑、查询和维护&#xff0c;适合数据库开发者和数据分析师使用。 功能特性 SQLiteStudio 提供的主要功能包括&#xff1a; 免费开源&#xff0c;可…...

Mysql配置文件My.cnf(my.ini)配置参数说明

一、my.cnf 配置文件路径&#xff1a;/etc/my.cnf&#xff0c;在调整了该文件内容后&#xff0c;需要重启mysql才可生效。 1、主要参数 basedir path # 使用给定目录作为根目录(安装目录)。 datadir path # 从给定目录读取数据库文件。 pid-file filename # 为mysq…...

聊天模型集成指南

文章目录 聊天模型集成指南Anthropic聊天模型集成PaLM2聊天模型PaLM2API的核心功能OpenAl聊天模型集成聊天模型集成指南 随着GPT-4等大语言模型的突破,聊天机器人已经不仅仅是简单的问答工具,它们现在广泛应用于客服、企业咨询、电子商务等多种场景,为用户提供准确、快速的反…...

搭建农产品管理可视化,助力农业智能化

利用图扑 HT 搭建农产品管理可视化平台&#xff0c;实现从生产到销售的全流程监控。平台通过物联网传感器实时采集土壤湿度、温度、光照等数据&#xff0c;支持智慧大棚的灌溉、施肥、病虫害防治等功能。同时&#xff0c;农产品调度中心大屏可展示市场交易数据、库存状态、物流…...

tee命令

tee 是一个在 Unix/Linux 系统中常用的命令&#xff0c;它用于读取标准输入&#xff08;stdin&#xff09;&#xff0c;并将其内容同时输出到标准输出&#xff08;stdout&#xff09;和文件中。它常用于将命令的输出保存到文件的同时&#xff0c;也显示在终端屏幕上。 基本语法…...

国自然面上项目|基于海量多模态影像深度学习的肝癌智能诊断研究|基金申请·25-03-07

小罗碎碎念 今天和大家分享一个国自然面上项目&#xff0c;执行年限为2020.01&#xff5e;2023.12&#xff0c;直接费用为65万元。 该项目旨在利用多模态医学影像&#xff0c;通过深度学习技术&#xff0c;解决肝癌诊断中的难题&#xff0c;如影像的快速配准融合、海量特征筛选…...

「勾芡」和「淋明油」是炒菜收尾阶段提升菜品口感和观感的关键操作

你提到的「勾芡」和「淋明油」是炒菜收尾阶段提升菜品口感和观感的关键操作&#xff0c;背后涉及食品科学中的物理化学变化。以下从原理到实操的深度解析&#xff1a; 一、勾芡&#xff1a;淀粉的“精密控温游戏” 1. 科学原理 淀粉糊化&#xff08;Gelatinization&#xff0…...

ROS云课三分钟-差动移动机器人导航报告如何撰写-及格边缘疯狂试探

提示词&#xff1a;基于如上所有案例并结合roslaunch teb_local_planner_tutorials robot_diff_drive_in_stage.launch和上面所有对话内容&#xff0c;设计一个差速移动机器人仿真实验&#xff0c;并完成报告的全文撰写。 差速移动机器人导航仿真实验报告 一、实验目的 验证 T…...