当前位置: 首页 > 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: 发布服务质量, 参…...

pam_env.so模块配置解析

在PAM&#xff08;Pluggable Authentication Modules&#xff09;配置中&#xff0c; /etc/pam.d/su 文件相关配置含义如下&#xff1a; 配置解析 auth required pam_env.so1. 字段分解 字段值说明模块类型auth认证类模块&#xff0c;负责验证用户身份&am…...

Maven 概述、安装、配置、仓库、私服详解

目录 1、Maven 概述 1.1 Maven 的定义 1.2 Maven 解决的问题 1.3 Maven 的核心特性与优势 2、Maven 安装 2.1 下载 Maven 2.2 安装配置 Maven 2.3 测试安装 2.4 修改 Maven 本地仓库的默认路径 3、Maven 配置 3.1 配置本地仓库 3.2 配置 JDK 3.3 IDEA 配置本地 Ma…...

Linux --进程控制

本文从以下五个方面来初步认识进程控制&#xff1a; 目录 进程创建 进程终止 进程等待 进程替换 模拟实现一个微型shell 进程创建 在Linux系统中我们可以在一个进程使用系统调用fork()来创建子进程&#xff0c;创建出来的进程就是子进程&#xff0c;原来的进程为父进程。…...

Angular微前端架构:Module Federation + ngx-build-plus (Webpack)

以下是一个完整的 Angular 微前端示例&#xff0c;其中使用的是 Module Federation 和 npx-build-plus 实现了主应用&#xff08;Shell&#xff09;与子应用&#xff08;Remote&#xff09;的集成。 &#x1f6e0;️ 项目结构 angular-mf/ ├── shell-app/ # 主应用&…...

AI病理诊断七剑下天山,医疗未来触手可及

一、病理诊断困局&#xff1a;刀尖上的医学艺术 1.1 金标准背后的隐痛 病理诊断被誉为"诊断的诊断"&#xff0c;医生需通过显微镜观察组织切片&#xff0c;在细胞迷宫中捕捉癌变信号。某省病理质控报告显示&#xff0c;基层医院误诊率达12%-15%&#xff0c;专家会诊…...

SQL慢可能是触发了ring buffer

简介 最近在进行 postgresql 性能排查的时候,发现 PG 在某一个时间并行执行的 SQL 变得特别慢。最后通过监控监观察到并行发起得时间 buffers_alloc 就急速上升,且低水位伴随在整个慢 SQL,一直是 buferIO 的等待事件,此时也没有其他会话的争抢。SQL 虽然不是高效 SQL ,但…...

JS手写代码篇----使用Promise封装AJAX请求

15、使用Promise封装AJAX请求 promise就有reject和resolve了&#xff0c;就不必写成功和失败的回调函数了 const BASEURL ./手写ajax/test.jsonfunction promiseAjax() {return new Promise((resolve, reject) > {const xhr new XMLHttpRequest();xhr.open("get&quo…...

android13 app的触摸问题定位分析流程

一、知识点 一般来说,触摸问题都是app层面出问题,我们可以在ViewRootImpl.java添加log的方式定位;如果是touchableRegion的计算问题,就会相对比较麻烦了,需要通过adb shell dumpsys input > input.log指令,且通过打印堆栈的方式,逐步定位问题,并找到修改方案。 问题…...

Bean 作用域有哪些?如何答出技术深度?

导语&#xff1a; Spring 面试绕不开 Bean 的作用域问题&#xff0c;这是面试官考察候选人对 Spring 框架理解深度的常见方式。本文将围绕“Spring 中的 Bean 作用域”展开&#xff0c;结合典型面试题及实战场景&#xff0c;帮你厘清重点&#xff0c;打破模板式回答&#xff0c…...

适应性Java用于现代 API:REST、GraphQL 和事件驱动

在快速发展的软件开发领域&#xff0c;REST、GraphQL 和事件驱动架构等新的 API 标准对于构建可扩展、高效的系统至关重要。Java 在现代 API 方面以其在企业应用中的稳定性而闻名&#xff0c;不断适应这些现代范式的需求。随着不断发展的生态系统&#xff0c;Java 在现代 API 方…...