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

Editor工具开发实用篇:EditorGUI/EditorGUILayout的区别和EditorGUILayout的方法介绍

目录

一:EditorGUI和EditorGUILayout区别

二:EditorGUILayout

1.EditorGUILayout.BeginFadeGroup(float value);

2.EditorGUILayout.BeginHorizontal  EditorGUILayout.BeginVertical

3.EditorGUILayout.BeginScrollView

4.EditorGUILayout.BeginToggleGroup&&EditorGUILayout.Toggle

5.EditorGUILayout.BoundsField  EditorGUILayout.BoundsIntField  public static Color ColorField   等等等....

6.EditorGUILayout.DropdownButton

7.EditorGUILayout.BeginBuildTargetSelectionGrouping

8.EditorGUILayout.EnumFlagsField

9.EditorGUILayout.EnumPopup

10.EditorGUILayout.Foldout

11.EditorGUILayout.GetControlRect

12.EditorGUILayout.GradientField

13.EditorGUILayout.HelpBox

14.EditorGUILayout.IntSlider||EditorGUILayout.Slider

15.EditorGUILayout.ObjectField

16.EditorGUILayout.PrefixLabel

17.EditorGUILayout.PropertyField

18.EditorGUILayout.SelectableLabel

19.EditorGUILayout.Space();

三.所有代码:


一:EditorGUI和EditorGUILayout区别

官方的api给出的是EditorGUILayout是EditorGUI的自动布局版本

什么意思呢?

如果我们进入到EditorGUI和EditorGUILayout的代码里可以看到EditorGUI类里有的方法 基本在EditorGUILayout类里都有相对应的方法 

区别就是:
EditorGUI类的方法基本上都要传入一个参数Rect包含了位置和大小而EditorGUILayout不需要

这样看的话我们着重了解一下EditorGUILayout

二:EditorGUILayout

常用方法:

1.EditorGUILayout.BeginFadeGroup(float value);

解释: 开始一个可隐藏/显示的组,并且过渡将生成动画。

eg:

private void OnGUI() {if(EditorGUILayout.BeginFadeGroup(0)) {GUILayout.TextArea("1\n2\n3\n4\n");}EditorGUILayout.EndFadeGroup();}

效果:

修改值为0.5f

private void OnGUI() {if(EditorGUILayout.BeginFadeGroup(0.5f)) {GUILayout.TextArea("1\n2\n3\n4\n");}EditorGUILayout.EndFadeGroup();}

效果:

 

修改为1

private void OnGUI() {if(EditorGUILayout.BeginFadeGroup(1)) {GUILayout.TextArea("1\n2\n3\n4\n");}EditorGUILayout.EndFadeGroup();}

效果:

 

2.EditorGUILayout.BeginHorizontal
  EditorGUILayout.BeginVertical

解释:开始一个水平组/垂直组
eg:

        EditorGUILayout.BeginHorizontal();GUILayout.Button("H_Btn1");GUILayout.Button("H_Btn2");EditorGUILayout.EndHorizontal();EditorGUILayout.BeginVertical();GUILayout.Button("V_Btn1");GUILayout.Button("V_Btn1");EditorGUILayout.EndVertical();

效果:

3.EditorGUILayout.BeginScrollView

解释:开始一个自动布局的滚动视图。
eg:

scrolpos = EditorGUILayout.BeginScrollView(scrolpos, GUILayout.Width(80), GUILayout.Height(80));GUILayout.Label("item1111111111111");GUILayout.Label("item2");GUILayout.Label("item3");GUILayout.Label("item4");GUILayout.Label("item5");EditorGUILayout.EndScrollView();

效果:

 

4.EditorGUILayout.BeginToggleGroup&&EditorGUILayout.Toggle

BeginToggleGroup  解释:开始一个垂直组,带有可一次性启用或禁用所有控件的开关
Toggle                       解释:创建一个开关
eg:

bool showToggle;private void OnGUI() {showToggle =  EditorGUILayout.BeginToggleGroup("toggleGroup", showToggle);EditorGUILayout.Toggle("toggle1", showToggle);EditorGUILayout.Toggle("toggle2", !showToggle);EditorGUILayout.EndToggleGroup();}

效果:

 

5.EditorGUILayout.BoundsField
  EditorGUILayout.BoundsIntField
  public static Color ColorField   等等等....

unity的api 或者C# api 的一些类型的展示
eg:

    Bounds Bounds;BoundsInt boundsInt;Color color;private void OnGUI() {EditorGUILayout.BeginVertical();Bounds = EditorGUILayout.BoundsField(Bounds);boundsInt = EditorGUILayout.BoundsIntField(boundsInt);color = EditorGUILayout.ColorField(color);EditorGUILayout.EndVertical();}

效果:

6.EditorGUILayout.DropdownButton

解释:创建一个能够对鼠标按下做出反应的按钮,用于显示您自己的下拉菜单内容
eg:

private void OnGUI() {
EditorGUILayout.BeginVertical();GUIContent dropDown = new GUIContent("菜单");if(EditorGUILayout.DropdownButton(dropDown, FocusType.Keyboard)) {GenericMenu genericMenu = new GenericMenu();genericMenu.AddItem(new GUIContent("文件"), true, Select);genericMenu.AddItem(new GUIContent("工具"), false, Select);genericMenu.AddSeparator("");genericMenu.AddItem(new GUIContent("设置/设置1"), true, Select);genericMenu.AddItem(new GUIContent("设置/设置2"), false, Select);genericMenu.AddItem(new GUIContent("主题/1"), true, Select);genericMenu.AddSeparator("主题/");genericMenu.AddItem(new GUIContent("主题/2"), false, Select);genericMenu.AddDisabledItem(new GUIContent("不可更改"));Rect rect = GUILayoutUtility.GetLastRect();genericMenu.DropDown(rect);}EditorGUILayout.EndVertical();
}private void Select() {Debug.Log("Select");}

效果:

修改:
            Rect rect = GUILayoutUtility.GetLastRect();
            genericMenu.DropDown(rect);

为:
            genericMenu.ShowAsContext();

效果:

拓展:GenericMenu 创建自定义上下文菜单和下拉菜单。

变量
allowDuplicateNames
允许菜单具有多个同名的菜单项。


公共函数
AddDisabledItem
向菜单添加已禁用的项。
AddItem
向菜单添加一个项。
AddSeparator
向菜单添加一个分隔符项。
DropDown
在给定屏幕矩形中显示菜单。
GetItemCount
获取菜单中的项数。
ShowAsContext
右键单击时在鼠标下显示菜单。


委托
MenuFunction
回调函数,菜单项选中时调用。
MenuFunction2
带有用户数据的回调函数,菜单项选中时调用。

7.EditorGUILayout.BeginBuildTargetSelectionGrouping

解释:开始构建目标组并返回所选 BuildTargetGroup
eg:

BuildTargetGroup buildTargetGroup = EditorGUILayout.BeginBuildTargetSelectionGrouping();if(buildTargetGroup == BuildTargetGroup.Android) {GUILayout.Button("A_Btn1");GUILayout.Button("A_Btn2");} else if(buildTargetGroup == BuildTargetGroup.iOS) {GUILayout.Button("I_Btn1");GUILayout.Button("I_Btn2");} else if(buildTargetGroup == BuildTargetGroup.Standalone) {GUILayout.Button("S_Btn1");GUILayout.Button("S_Btn2");} else if(buildTargetGroup == BuildTargetGroup.WebGL) {GUILayout.Button("W_Btn1");GUILayout.Button("W_Btn2");}EditorGUILayout.EndBuildTargetSelectionGrouping();

效果:

 

 

 

8.EditorGUILayout.EnumFlagsField

解释:单击后,系统会为枚举类型每个值显示带有选项的菜单
eg:

public enum CONENUM {NONE = 1 << 0,NORMAL = 1 << 2,SPE = 1 << 3,OTHER = 1 << 4,ALL = 1 << 5,
}
CONENUM cONENUM;private void OnGUI() {EditorGUILayout.BeginVertical();cONENUM = (CONENUM)EditorGUILayout.EnumFlagsField(cONENUM);EditorGUILayout.EndVertical();
}

效果:

 

9.EditorGUILayout.EnumPopup

解释:创建一个枚举弹出选择字段
eg:

public enum CONENUM {NONE = 1 << 0,NORMAL = 1 << 2,SPE = 1 << 3,OTHER = 1 << 4,ALL = 1 << 5,
}
CONENUM cONENUM;private void OnGUI() {EditorGUILayout.BeginVertical();cONENUM = (CONENUM)EditorGUILayout.EnumPopup("ENUM", cONENUM);EditorGUILayout.EndVertical();
}

效果:

10.EditorGUILayout.Foldout

解释:创建一个左侧带有折叠箭头的标签
eg:

 bool foldout = false;private void OnGUI() {EditorGUILayout.BeginVertical();foldout = EditorGUILayout.Foldout(foldout, "这个是什么意思,带折叠箭头的标签???");if(foldout) {GUILayout.Label("来吧展示!");}EditorGUILayout.EndVertical();
}

效果:

 

 

11.EditorGUILayout.GetControlRect

解释:获取编辑器控件的矩形。
eg:    

Rect controlRect;string selectPath;private void OnGUI() {EditorGUILayout.BeginVertical();controlRect = EditorGUILayout.GetControlRect(true, 100);selectPath = EditorGUI.TextField(controlRect, selectPath);EditorGUILayout.EndVertical();
}

效果:

12.EditorGUILayout.GradientField

解释:创建一个用于编辑 Gradient 的字段。
eg: 

Gradient gradient = new Gradient();private void OnGUI() {EditorGUILayout.BeginVertical();gradient = EditorGUILayout.GradientField(gradient);EditorGUILayout.EndVertical();}

效果:

 

 

13.EditorGUILayout.HelpBox

解释:创建一个带有发送给用户的消息的帮助框。
eg:

private void OnGUI() {EditorGUILayout.BeginVertical();EditorGUILayout.HelpBox("一个带有发送给用户消息的帮助框?", MessageType.Error);EditorGUILayout.EndVertical();}

效果:

 

14.EditorGUILayout.IntSlider||EditorGUILayout.Slider

解释:创建一个滑动条,用户可以进行拖动以在最小值和最大值之间更改整数值。
eg:

int sliderValue = 0;private void OnGUI() {EditorGUILayout.BeginVertical();sliderValue = EditorGUILayout.IntSlider(sliderValue, 0, 100);EditorGUILayout.EndVertical();}

效果:

 

注: EditorGUILayout.Slider 区别是支持浮点类型

15.EditorGUILayout.ObjectField

解释:生成一个可接收任何对象类型的字段。
eg:

UnityEngine.Object obj;private void OnGUI() {EditorGUILayout.BeginVertical();obj = EditorGUILayout.ObjectField(obj, typeof(UnityEngine.Object), true);EditorGUILayout.EndVertical();}

效果:

16.EditorGUILayout.PrefixLabel

解释:创建一个显示在特定控件前标签
eg:

Color color;
private void OnGUI() {EditorGUILayout.BeginVertical();EditorGUILayout.PrefixLabel("Color");color = EditorGUILayout.ColorField(color);EditorGUILayout.EndVertical();}

效果:

 

17.EditorGUILayout.PropertyField

解释:为 SerializedProperty 生成一个字段
eg:

public class TestBtn: MonoBehaviour {[HideInInspector]public string _name;private void OnGUI() {EditorGUILayout.BeginHorizontal();if(GUILayout.Button(_name)) {}EditorGUILayout.EndHorizontal();}
}
[CustomEditor(typeof(TestBtn))]
public class TestBtnTool : Editor {SerializedProperty serializedProperty;GUIContent gUIContent;private void Awake() {//反射拿到_name 赋值给serializedPropertyif(serializedObject.FindProperty("_name") != null) {serializedProperty = serializedObject.FindProperty("_name");}gUIContent = new GUIContent("L_Name");}public override void OnInspectorGUI() {base.OnInspectorGUI();if(serializedProperty != null) {EditorGUILayout.PropertyField(serializedProperty, gUIContent);//保存 serializedObject  serializedObject是TestBtn 的序列化serializedObject.ApplyModifiedProperties();}}
}

效果:

 

修改L_Name

 

 

18.EditorGUILayout.SelectableLabel

解释:生成一个可选择标签字段。(用于显示可复制粘贴的只读信息。)
eg:

private void OnGUI() {EditorGUILayout.BeginVertical();EditorGUILayout.SelectableLabel("1");EditorGUILayout.SelectableLabel("2");EditorGUILayout.SelectableLabel("3");EditorGUILayout.EndVertical();
}

修改:

 注:1 2 3 可复制

19.EditorGUILayout.Space();

用在两个控件中间 会有一个空格
eg:      

EditorGUILayout.BeginVertical();GUILayout.Button("V_Btn1");//EditorGUILayout.Space();GUILayout.Button("V_Btn1");EditorGUILayout.EndVertical();

效果:

 

使用后:

 

三.所有代码:

using System;
using System.Collections.Generic;
using UnityEditor;
using UnityEditor.AnimatedValues;
using UnityEngine;public class EditorToolWindowOne: EditorWindow {public static EditorToolWindowOne inst;float progress;[MenuItem("EditorTool/OpenWindowOne")]public static void CreateWindow() {inst = GetWindow<EditorToolWindowOne>(true, "这是一个浮动窗口");inst.Show();}private void Awake() {}Vector2 scrolpos = new Vector2(100, 100);bool showToggle;Bounds Bounds;BoundsInt boundsInt;Color color;CONENUM cONENUM;bool foldout = false;Rect controlRect;string selectPath;Gradient gradient = new Gradient();int sliderValue = 0;UnityEngine.Object obj;private void OnGUI() {BuildTargetGroup buildTargetGroup = EditorGUILayout.BeginBuildTargetSelectionGrouping();if(buildTargetGroup == BuildTargetGroup.Android) {GUILayout.Button("A_Btn1");GUILayout.Button("A_Btn2");} else if(buildTargetGroup == BuildTargetGroup.iOS) {GUILayout.Button("I_Btn1");GUILayout.Button("I_Btn2");} else if(buildTargetGroup == BuildTargetGroup.Standalone) {GUILayout.Button("S_Btn1");GUILayout.Button("S_Btn2");} else if(buildTargetGroup == BuildTargetGroup.WebGL) {GUILayout.Button("W_Btn1");GUILayout.Button("W_Btn2");}EditorGUILayout.EndBuildTargetSelectionGrouping();if(EditorGUILayout.BeginFadeGroup(1)) {GUILayout.TextArea("1\n2\n3\n4\n");}EditorGUILayout.EndFadeGroup();EditorGUILayout.BeginVertical();GUILayout.Button("V_Btn1");EditorGUILayout.Space();GUILayout.Button("V_Btn1");EditorGUILayout.EndVertical();scrolpos = EditorGUILayout.BeginScrollView(scrolpos, GUILayout.Width(80), GUILayout.Height(80));GUILayout.Label("item1111111111111");GUILayout.Label("item2");GUILayout.Label("item3");GUILayout.Label("item4");GUILayout.Label("item5");EditorGUILayout.EndScrollView();showToggle =  EditorGUILayout.BeginToggleGroup("toggleGroup", showToggle);EditorGUILayout.Toggle("toggle1", showToggle);EditorGUILayout.Toggle("toggle2", !showToggle);EditorGUILayout.EndToggleGroup();EditorGUILayout.BeginVertical();Bounds = EditorGUILayout.BoundsField(Bounds);boundsInt = EditorGUILayout.BoundsIntField(boundsInt);color = EditorGUILayout.ColorField(color);GUIContent dropDown = new GUIContent("菜单");if(EditorGUILayout.DropdownButton(dropDown, FocusType.Keyboard)) {GenericMenu genericMenu = new GenericMenu();genericMenu.AddItem(new GUIContent("文件"), true, Select);genericMenu.AddItem(new GUIContent("工具"), false, Select);genericMenu.AddSeparator("");genericMenu.AddItem(new GUIContent("设置/设置1"), true, Select);genericMenu.AddItem(new GUIContent("设置/设置2"), false, Select);genericMenu.AddItem(new GUIContent("主题/1"), true, Select);genericMenu.AddSeparator("主题/");genericMenu.AddItem(new GUIContent("主题/2"), false, Select);genericMenu.AddDisabledItem(new GUIContent("不可更改"));genericMenu.ShowAsContext();//Rect rect = GUILayoutUtility.GetLastRect();//genericMenu.DropDown(rect);}EditorGUILayout.EndVertical();EditorGUILayout.BeginVertical();cONENUM = (CONENUM)EditorGUILayout.EnumFlagsField("enum", cONENUM);EditorGUILayout.EndVertical();EditorGUILayout.BeginVertical();cONENUM = (CONENUM)EditorGUILayout.EnumPopup("ENUM", cONENUM);EditorGUILayout.EndVertical();EditorGUILayout.BeginVertical();foldout = EditorGUILayout.Foldout(foldout, "这个是什么意思,带折叠箭头的标签???");if(foldout) {GUILayout.Label("来吧展示!");}EditorGUILayout.EndVertical();EditorGUILayout.BeginVertical();controlRect = EditorGUILayout.GetControlRect(true, 100);selectPath = EditorGUI.TextField(controlRect, selectPath);EditorGUILayout.EndVertical();EditorGUILayout.BeginVertical();gradient = EditorGUILayout.GradientField(gradient);EditorGUILayout.EndVertical();EditorGUILayout.BeginVertical();EditorGUILayout.HelpBox("一个带有发送给用户消息的帮助框?", MessageType.Error);EditorGUILayout.EndVertical();EditorGUILayout.BeginVertical();sliderValue = EditorGUILayout.IntSlider(sliderValue, 0, 100);EditorGUILayout.EndVertical();EditorGUILayout.BeginVertical();obj = EditorGUILayout.ObjectField(obj, typeof(UnityEngine.Object), true);EditorGUILayout.EndVertical();EditorGUILayout.BeginVertical();EditorGUILayout.PrefixLabel("Color");color = EditorGUILayout.ColorField(color);EditorGUILayout.EndVertical();EditorGUILayout.BeginVertical();EditorGUILayout.SelectableLabel("1");EditorGUILayout.SelectableLabel("2");EditorGUILayout.SelectableLabel("3");EditorGUILayout.EndVertical();}private void Select() {Debug.Log("Select");}
}
public enum CONENUM {NONE = 1 << 0,NORMAL = 1 << 2,SPE = 1 << 3,OTHER = 1 << 4,ALL = 1 << 5,
}

 效果:

如果有不对的地方希望能指出来 感激不尽。
另外,不熟悉的代码一定要写一下加深记忆 只用看的记不了太久。 

相关文章:

Editor工具开发实用篇:EditorGUI/EditorGUILayout的区别和EditorGUILayout的方法介绍

目录 一&#xff1a;EditorGUI和EditorGUILayout区别 二&#xff1a;EditorGUILayout 1.EditorGUILayout.BeginFadeGroup(float value); 2.EditorGUILayout.BeginHorizontal EditorGUILayout.BeginVertical 3.EditorGUILayout.BeginScrollView 4.EditorGUILayout.BeginT…...

(五十二)大白话不断在表中插入数据时,物理存储是如何进行页分裂的?.md

上回我们讲到了数据页的物理存储结构&#xff0c;数据页之间是组成双向链表的&#xff0c;数据页内部的数据行是组成单向链表的&#xff0c;每个数据页内根据主键做了一个页目录 然后一般来说&#xff0c;你没有索引的情况下&#xff0c;所有的数据查询&#xff0c;其实在物理…...

Unity 渲染顺序

Unity中的渲染顺序自上而下大致分为三层渲染优先级 Camera depth > Sorting Layer > Order in Layer > RenderQueueCamera depth:越小越优先&#xff08;大的显示在小的前面&#xff09;如图&#xff1a;尽管Sphere距离摄像机较远&#xff0c;但由于Camera_Sphere dep…...

短视频美颜sdk人脸编辑技术详解、美颜sdk代码分析

短视频美颜sdk中人脸编辑技术可以将人像风格进行转变&#xff0c;小编认为这也是未来的美颜sdk的一个重要发展方向&#xff0c;下文小编将为大家讲解一下短视频美颜sdk中人脸编辑的关键点。 一、人脸编辑的细分关键点 1、年龄 通过更改人脸的年龄属性&#xff0c;可用于模仿人…...

error: expected declaration specifiers or ‘...’ before ‘(’ token

一、问题 最近写函数时&#xff0c;遇到了一个比较奇怪的问题&#xff0c;相信也好多人遇到一下的问题&#xff1a; error: expected declaration specifiers or ‘...’ before ‘(’ token代码如下&#xff1a; #include<stdio.h> struct stu{char *name;int score;…...

系列七、索引

一、索引概述 1.1、概述 索引&#xff08;index&#xff09;是帮助MySQL高效获取数据的数据结构(有序)。在数据之外&#xff0c;数据库系统还维护着满足特定查找算法的数据结构&#xff0c;这些数据结构以某种方式引用&#xff08;指向&#xff09;数据&#xff0c; 这样就可以…...

Java开发 - Elasticsearch初体验

目录 前言 什么是es&#xff1f; 为什么要使用es&#xff1f; es查询的原理&#xff1f; es需要准备什么&#xff1f; es基本用法 创建工程 添加依赖 创建操作es的文件 使用ik分词插件 Spring Data 项目中引入Spring Data 添加依赖 添加配置 创建操作es的业务逻…...

mysql进阶

mysql进阶视图视图是一个基于查询的虚拟表&#xff0c;封装了一条sql语句,通俗的解释&#xff0c;视图就是一条select查询之后的结果集&#xff0c;视图并不存储数据&#xff0c;数据仍旧存储在表中。创建视图语句&#xff1a;create view view_admin as select * from admin使…...

SD卡损坏了?储存卡恢复数据就靠这3个方法

作为一种方便的储存设备&#xff0c;SD卡在我们的日常生活中使用非常广泛。但是&#xff0c;有时候我们可能会遇到SD卡损坏的情况&#xff0c;这时候里面存储的数据就会受到影响。SD卡里面保存着我们很多重要的数据&#xff0c;有些还是工作必须要使用的。 如果您遇到了这种情…...

springboot+实践(总结到位)

一。【SpringBoot注解-1】 牛逼&#xff1a;云深i不知处 【SpringBoot注解-1】&#xff1a;常见注解总览_云深i不知处的博客-CSDN博客 二。【SpringBoot-3】Lombok使用详解 【SpringBoot-3】Lombok使用详解_云深i不知处的博客-CSDN博客_springboot lombok 三&#xff0…...

CorelDRAW2023新功能有哪些?最新版cdr下载安装教程

使用 CorelDRAW2023&#xff0c;随时随都能进行设计创作。在 Windows或Mac上使用专为此平台设计的直观界面&#xff0c;以自己的风格尽情自由创作。同全球数百万信赖CorelDRAW Graphics Suite 的艺术家、设计者及小型企业主一样&#xff0c;大胆展现真我&#xff0c;创作出众的…...

PLC 程序设计标准化方法

PLC 程序设计的标准化方法先从内容或者方法层面进行流程的分解,将分解的内容称为要素,要素的有机结合便构成了标准化的设计。流程标准化设计完成之后需要对各个要素分别进行标准化的设计。2.1、 PLC 程序设计的要素分解与有机结合根据软件程序设计的一般性方法结合PLC 程序设计…...

设计模式-笔记

文章目录七大原则单例模式桥模式 bridge观察者模式 observer责任链模式 Chain of Responsibility命令模式 Command迭代器模式 Iterator中介者模式 Mediator享元模式 Flyweight Pattern组合模式 composite装饰模式 Decorator外观模式 Facade简单工厂模式工厂方法模式工厂抽象模式…...

【全志T113-S3_100ask】12-3 Linux蓝牙通信实战(基于BlueZ的C语言BLE蓝牙编程)

【全志T113-S3_100ask】12-3 Linux蓝牙通信实战(基于BlueZ的C语言BLE蓝牙编程 背景(一)获取BlueZ源码(二)首次编译2-1 编写Makefile2-2 make编译2-3 首次测试2-3-1 开发板操作2-3-2 安卓端操作(三)源码分析3-1 程序入口3-2 蓝牙设备名称3-3 GATT服务(四)实战4-1 添加B…...

Java学习之路003——集合

1、 代码演示 【1】新增一个类&#xff0c;用来测试集合。先创建一组数组&#xff0c;数组可以存放不同的数据类型。对于Object类型的数组元素&#xff0c;可以通过.getClass方法获取到具体类型。 【2】如果数组指定类型为int的时候&#xff0c;使用.getClass()就会提示错误。 …...

生成和查看dump文件

在日常开发中&#xff0c;即使代码写得有多谨慎&#xff0c;免不了还是会发生各种意外的事件&#xff0c;比如服务器内存突然飙高&#xff0c;又或者发生内存溢出(OOM)。当发生这种情况时&#xff0c;我们怎么去排查&#xff0c;怎么去分析原因呢&#xff1f; 1. 什么是dump文…...

K8S集群1.24使用docker作为容器运行时出现就绪探针间歇性异常

文章目录1. 环境介绍2. 异常信息3. 分析问题3.1 kubernetes 健康检查3.1.1 存活探针3.1.2 就绪探针3.1.3 启动探针3.2 检测方法4. 解决办法1. 环境介绍 组件版本kubernetes1.24.2docker18.03.1-cecri-docker0.2.6 2. 异常信息 最近监测到 kubernetes 集群上 calico-node Pod 运…...

士大夫身份第三方水电费第三方

package com.snmocha.snbpm.job;import org.springframework.stereotype.Component;import com.xxl.job.core.handler.annotation.XxlJob;import lombok.extern.slf4j.Slf4j;/*** Demo定时任务.* Author&#xff1a;zhoudd* Date&#xff1a;2023-01-15*/ Component Slf4j publ…...

RDO一体化部署OpenStack

RDO一体化部署OpenStack 环境准备 安装centos7 [外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-J785hZvT-1677578418769)(C:\Users\HONOR\AppData\Roaming\Typora\typora-user-images\image-20230228171254675.png)] 使用vmware安装安装centos7&a…...

CC2530+ESP8266使用MQTT协议上传阿里云的问题

ATMQTTPUB<LinkID>,<"topic">,<"data">,<qos>,<retain>LinkID: 当前只支持 0 topic: 发布主题, 最长 64 字节 data: 发布消息, data 不能包含 \0, 请确保整条 ATMQTTPUB 不超过 AT 指令的最大长度限制 qos: 发布服务质量, 参…...

(LeetCode 每日一题) 3442. 奇偶频次间的最大差值 I (哈希、字符串)

题目&#xff1a;3442. 奇偶频次间的最大差值 I 思路 &#xff1a;哈希&#xff0c;时间复杂度0(n)。 用哈希表来记录每个字符串中字符的分布情况&#xff0c;哈希表这里用数组即可实现。 C版本&#xff1a; class Solution { public:int maxDifference(string s) {int a[26]…...

React hook之useRef

React useRef 详解 useRef 是 React 提供的一个 Hook&#xff0c;用于在函数组件中创建可变的引用对象。它在 React 开发中有多种重要用途&#xff0c;下面我将全面详细地介绍它的特性和用法。 基本概念 1. 创建 ref const refContainer useRef(initialValue);initialValu…...

Go 语言接口详解

Go 语言接口详解 核心概念 接口定义 在 Go 语言中&#xff0c;接口是一种抽象类型&#xff0c;它定义了一组方法的集合&#xff1a; // 定义接口 type Shape interface {Area() float64Perimeter() float64 } 接口实现 Go 接口的实现是隐式的&#xff1a; // 矩形结构体…...

Spring AI与Spring Modulith核心技术解析

Spring AI核心架构解析 Spring AI&#xff08;https://spring.io/projects/spring-ai&#xff09;作为Spring生态中的AI集成框架&#xff0c;其核心设计理念是通过模块化架构降低AI应用的开发复杂度。与Python生态中的LangChain/LlamaIndex等工具类似&#xff0c;但特别为多语…...

短视频矩阵系统文案创作功能开发实践,定制化开发

在短视频行业迅猛发展的当下&#xff0c;企业和个人创作者为了扩大影响力、提升传播效果&#xff0c;纷纷采用短视频矩阵运营策略&#xff0c;同时管理多个平台、多个账号的内容发布。然而&#xff0c;频繁的文案创作需求让运营者疲于应对&#xff0c;如何高效产出高质量文案成…...

C++:多态机制详解

目录 一. 多态的概念 1.静态多态&#xff08;编译时多态&#xff09; 二.动态多态的定义及实现 1.多态的构成条件 2.虚函数 3.虚函数的重写/覆盖 4.虚函数重写的一些其他问题 1&#xff09;.协变 2&#xff09;.析构函数的重写 5.override 和 final关键字 1&#…...

人机融合智能 | “人智交互”跨学科新领域

本文系统地提出基于“以人为中心AI(HCAI)”理念的人-人工智能交互(人智交互)这一跨学科新领域及框架,定义人智交互领域的理念、基本理论和关键问题、方法、开发流程和参与团队等,阐述提出人智交互新领域的意义。然后,提出人智交互研究的三种新范式取向以及它们的意义。最后,总结…...

Golang——9、反射和文件操作

反射和文件操作 1、反射1.1、reflect.TypeOf()获取任意值的类型对象1.2、reflect.ValueOf()1.3、结构体反射 2、文件操作2.1、os.Open()打开文件2.2、方式一&#xff1a;使用Read()读取文件2.3、方式二&#xff1a;bufio读取文件2.4、方式三&#xff1a;os.ReadFile读取2.5、写…...

LCTF液晶可调谐滤波器在多光谱相机捕捉无人机目标检测中的作用

中达瑞和自2005年成立以来&#xff0c;一直在光谱成像领域深度钻研和发展&#xff0c;始终致力于研发高性能、高可靠性的光谱成像相机&#xff0c;为科研院校提供更优的产品和服务。在《低空背景下无人机目标的光谱特征研究及目标检测应用》这篇论文中提到中达瑞和 LCTF 作为多…...

如何配置一个sql server使得其它用户可以通过excel odbc获取数据

要让其他用户通过 Excel 使用 ODBC 连接到 SQL Server 获取数据&#xff0c;你需要完成以下配置步骤&#xff1a; ✅ 一、在 SQL Server 端配置&#xff08;服务器设置&#xff09; 1. 启用 TCP/IP 协议 打开 “SQL Server 配置管理器”。导航到&#xff1a;SQL Server 网络配…...