RPG项目01_技能释放
基于“RPG项目01_新输入输出”,
修改脚本文件夹中的SkillBase脚本:

using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
//回复技能,魔法技能,物理技能
public enum SkillType { Up, Magic, Physics };
public class SkillBase : MonoBehaviour{
protected GameObject prefab;
protected SkillType type;//类型
protected string path = "Skill/";
protected string skillName;
protected int attValue;
public int mp;
protected People from;//从人物释放
protected People tPeople;//敌人目标
protected Dictionary<SkillType, UnityAction> typeWithSkill =
new Dictionary<SkillType, UnityAction>();
protected float time = 0;//计时器
protected float skillTime;//技能冷却时间
protected float delayTime;//延迟时间
protected float offset;//偏移量
protected Vector3 skillPoint;//攻击点
public bool IsRelease { get; private set; }//技能是否释放
protected int layer;//技能对哪个一层起作用
protected Collider[] cs;//技能碰撞体
public event UnityAction Handle;//处理方法
protected void Init(){
IsRelease = true;
layer = LayerMask.GetMask("MyPlayer") + LayerMask.GetMask("Enemy");
prefab = LoadManager.LoadGameObject(path + skillName);
typeWithSkill.Add(SkillType.Magic, MagicHurt);
typeWithSkill.Add(SkillType.Physics, PhysicsHurt);
typeWithSkill.Add(SkillType.Up, HpUp);
}
#region 技能
private void MagicHurt(){
cs = GetColliders();
foreach (Collider c in cs){
if (c.tag != from.tag){
c.GetComponent<People>().BeMagicHit(attValue, from);
c.GetComponent<People>().Anim.SetTrigger("Hurt");
}
}
}
private void PhysicsHurt(){
cs = GetColliders();
foreach (Collider c in cs){
if (c.tag != from.tag){
c.GetComponent<People>().BePhysicsHit(attValue, from);
c.GetComponent<People>().Anim.SetTrigger("Hurt");
}
}
}
private void HpUp(){
cs = GetColliders();
foreach (Collider c in cs){
if (c.tag == from.tag){
c.GetComponent<People>().AddHp(attValue);
}
}
}
#endregion
protected virtual Collider[] GetColliders(){
return null;
}
public float GetFillTime(){
if (IsRelease){
return 0;
}
time -= Time.deltaTime;
if (time < 0){
IsRelease = true;
}
return time / skillTime;
}
public void SetEventHandle(UnityAction fun){
Handle += fun;
}
public bool MayRelease(){
return (from.Mp + mp >= 0) && IsRelease;
}
//携程函数-技能释放执行
public virtual IEnumerator SkillPrefab(){
IsRelease = false;
time = skillTime;
yield return new WaitForSeconds(delayTime);//等待延迟时间
typeWithSkill[type]();
from.AddMp(mp);
skillPoint = from.transform.position + from.transform.forward * offset;
Quaternion qua = from.transform.rotation;//施放角度
GameObject effect = Instantiate(prefab, skillPoint, qua);
yield return new WaitForSeconds(3);//等待三秒
Handle?.Invoke();//时间调用
Destroy(effect);//特效销毁
}
}
技能基类创建完后创建技能子类StraightSkill


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class StraightSkill : SkillBase
{//直线技能
float length;
float width;
public StraightSkill(People p, string _name, SkillType _type,
float _length, float _width, int _att, int _mp, float _skillTime, float _delayTime, float _offset){
from = p;
length = _length;
width = _width;
skillName = _name;
mp = _mp;
type = _type;
attValue = _att;
skillTime = _skillTime;
delayTime = _delayTime;
offset = _offset;
Init();
}
protected override Collider[] GetColliders(){
skillPoint = from.transform.position + from.transform.forward * offset;
Vector3 bound = new Vector3(width * width, length);
return Physics.OverlapBox(skillPoint, bound, Quaternion.LookRotation(from.transform.forward), layer);
}
}
再创建球型子类:


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UIElements;
public class SphereSkill : SkillBase
{//球型技能
float r;
public SphereSkill(People p, string _name, SkillType _type, float _r,
int _att, int _mp, float _skillTime, float _delayTime, float _offset){
from = p;
r = _r;
skillName = _name;
mp = _mp;
type = _type;
attValue = _att;
skillTime = _skillTime;
delayTime = _delayTime;
offset = _offset;
Init();
}
protected override Collider[] GetColliders(){
skillPoint = from.transform.position + from.transform.forward * offset;
return Physics.OverlapSphere(skillPoint, r, layer);
}
}
接下来在角色类中修改代码添加技能:

using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.InputSystem;
using UnityEngine.UI;
public class MyPlayer : People{
[Header("==============子类变量==============")]
public Transform toolPanel;//道具面板
public Transform skillPanel;//技能面板
//public BagPanel bag;//背包
CharacterController contro;
Controls action;
float rvalue;
float spdFast = 1;
bool isHold;//握刀
GameObject sword;
GameObject swordBack;
public Image imageHp;
public Image imageMp;
new void Start() {
base.Start();
//获取自身角色控制器
contro = GetComponent<CharacterController>();
SetInput();
}
void SetInput(){
action = new Controls();
action.Enable();
action.MyCtrl.Move.started += Move;
action.MyCtrl.Move.performed += Move;
action.MyCtrl.Move.canceled += StopMove;
action.MyCtrl.Jump.started += Jump;
action.MyCtrl.Rotate.started += Rotate;
action.MyCtrl.Rotate.performed += Rotate;
action.MyCtrl.Fast.started += FastSpeed;
action.MyCtrl.Fast.performed += FastSpeed;
action.MyCtrl.Fast.canceled += FastSpeed;
action.MyCtrl.GetTool.started += ClickNpcAndTool;
action.MyCtrl.HoldRotate.performed += Hold;
action.MyCtrl.HoldRotate.canceled += Hold;
action.MyAtt.Att.started += Attack;
action.MyAtt.SwordOut.started += SwordOut;
}
private void SwordOut(InputAction.CallbackContext context)
{
if (GameManager.gameState != GameState.Play)
{
return;
}
Anim.SetBool("SwordOut", !Anim.GetBool("SwordOut"));
}
private void Attack(InputAction.CallbackContext context)
{
if (GameManager.gameState != GameState.Play)
{
return;
}
if (EventSystem.current.IsPointerOverGameObject())
{
return;
}
if (Anim.GetCurrentAnimatorStateInfo(0).IsName("Idle_Fight"))
{
Anim.SetInteger("Att", 1);
Anim.SetTrigger("AttTrigger");
}
else
{
int num = Anim.GetInteger("Att");
if (num == 6)
{
return;
}
if (Anim.GetCurrentAnimatorStateInfo(0).IsName("Light_Attk_" + num))
{
Anim.SetInteger("Att", num + 1);
}
}
}
public void PlayerAttack(string hurt)
{
Collider[] cs = Physics.OverlapBox(attPoint.position, Vector3.one * 0.5f,
attPoint.rotation, LayerMask.GetMask("Enemy"));
if (cs.Length <= 0)
{
return;
}
int value = (int)(Att * Anim.GetInteger("Att") * 0.5f);
foreach (Collider c in cs)
{
print(value);
}
}
public void PlayerAttackHard(string hurt)
{
Collider[] cs = Physics.OverlapBox(attPoint.position, Vector3.one * 0.5f,
attPoint.rotation, LayerMask.GetMask("Enemy"));
if (cs.Length <= 0)
{
return;
}
int value = (int)(Att * Anim.GetInteger("Att") * 0.5f);
foreach (Collider c in cs)
{
print(value);
print("让敌人播放击倒特效");
}
}
private void Hold(InputAction.CallbackContext context)
{
if (GameManager.gameState != GameState.Play)
{
return;
}
if (context.phase == InputActionPhase.Canceled)
{
isHold = false;
}
else
{
isHold = true;
}
}
private void ClickNpcAndTool(InputAction.CallbackContext context)
{
//throw new NotImplementedException();
}
private void FastSpeed(InputAction.CallbackContext context)
{
if (GameManager.gameState != GameState.Play)
{
return;
}
if (Anim.GetCurrentAnimatorStateInfo(0).IsName("Run") ||
Anim.GetCurrentAnimatorStateInfo(0).IsName("Run_Inplace"))
{
if (context.phase == InputActionPhase.Canceled)
{
spdFast = 1;
}
else
{
spdFast = 2;
}
}
}
private void Rotate(InputAction.CallbackContext context)
{
if (GameManager.gameState != GameState.Play)
{
return;
}
rvalue = context.ReadValue<float>();
}
private void Jump(InputAction.CallbackContext obj){
Anim.SetTrigger("Jump");
}
private void StopMove(InputAction.CallbackContext context){
Anim.SetBool("IsRun", false);
}
private void Move(InputAction.CallbackContext context){
if (GameManager.gameState != GameState.Play) {
return;
}
Anim.SetBool("IsRun", true);
}
void Ctrl()
{
if (Anim.GetCurrentAnimatorStateInfo(0).IsName("Run") ||
Anim.GetCurrentAnimatorStateInfo(0).IsName("Run_Inplace") ||
Anim.GetCurrentAnimatorStateInfo(0).IsName("Idle")||
Anim.GetCurrentAnimatorStateInfo(0).IsName("Idle_Fight")){
float f = action.MyCtrl.Move.ReadValue<float>();
contro.Move(transform.forward * f * Time.deltaTime * spdFast * Spd);
contro.Move(transform.up * -9.8f * Time.deltaTime);
if (isHold)
{
transform.Rotate(transform.up * rvalue * 0.3f);
}
}
}
void Update()
{
if (GameManager.gameState != GameState.Play)
{
return;
}
Ctrl();
}
#region 技能
protected override void InitSkill()
{
SphereSkill thunderBombCut = new SphereSkill(this, "雷爆斩", SkillType.Magic, 3, Att * 10, -100, 20, 0.3f, 0);
skills.Add(1, thunderBombCut);
SphereSkill windCircleCut = new SphereSkill(this, "旋风斩", SkillType.Physics, 3, Att * 8, -50, 20, 0.2f, 0);
skills.Add(2, windCircleCut);
StraightSkill thunderLightCut = new StraightSkill(this, "雷光斩", SkillType.Physics, 7, 0.5f, Att * 7, -50, 20, 0.2f, 0);
skills.Add(3, thunderLightCut);
SphereSkill oneCut = new SphereSkill(this, "归一斩", SkillType.Physics, 7, Att * 7, -30, 8, 0.2f, 0);
skills.Add(4, oneCut);
StraightSkill crossCut = new StraightSkill(this, "十字斩", SkillType.Physics, 25, 0.5f, Att * 3, -40, 20, 0.2f, 0);
skills.Add(5, crossCut);
SphereSkill thunderLargeCut = new SphereSkill(this, "轰雷斩", SkillType.Magic, 7, Att * 15, -120, 25, 0.35f, 0);
skills.Add(6, thunderLargeCut);
}
#endregion
}
在新输入系统中添加Skill文件包



在People基类添加基类

修改MyPlayer代码:

using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.InputSystem;
using UnityEngine.UI;
public class MyPlayer : People{
[Header("==============子类变量==============")]
public Transform toolPanel;//道具面板
public Transform skillPanel;//技能面板
//public BagPanel bag;//背包
CharacterController contro;
Controls action;
float rvalue;
float spdFast = 1;
bool isHold;//握刀
GameObject sword;
GameObject swordBack;
public Image imageHp;
public Image imageMp;
new void Start() {
base.Start();
//获取自身角色控制器
contro = GetComponent<CharacterController>();
SetInput();
}
void SetInput(){
action = new Controls();
action.Enable();
action.MyCtrl.Move.started += Move;
action.MyCtrl.Move.performed += Move;
action.MyCtrl.Move.canceled += StopMove;
action.MyCtrl.Jump.started += Jump;
action.MyCtrl.Rotate.started += Rotate;
action.MyCtrl.Rotate.performed += Rotate;
action.MyCtrl.Fast.started += FastSpeed;
action.MyCtrl.Fast.performed += FastSpeed;
action.MyCtrl.Fast.canceled += FastSpeed;
action.MyCtrl.GetTool.started += ClickNpcAndTool;
action.MyCtrl.HoldRotate.performed += Hold;
action.MyCtrl.HoldRotate.canceled += Hold;
action.MyAtt.Att.started += Attack;
action.MyAtt.SwordOut.started += SwordOut;
action.Skill.F1.started += SkillAtt;
action.Skill.F2.started += SkillAtt;
action.Skill.F3.started += SkillAtt;
action.Skill.F4.started += SkillAtt;
action.Skill.F5.started += SkillAtt;
action.Skill.F6.started += SkillAtt;
}
private void SkillAtt(InputAction.CallbackContext context)
{
if (!Anim.GetCurrentAnimatorStateInfo(0).IsName("Idle_Fight"))
{
return;
}
string[] str = context.control.ToString().Split('/');
int num = int.Parse(str[2][1].ToString());
SkillBase skill = skills[num];
if (!skill.MayRelease())
{
return;
}
Anim.SetTrigger("CSkill" + num);
ReleaseSkill(skill);
}
public void SkillClick(int num)
{
if (!Anim.GetCurrentAnimatorStateInfo(0).IsName("Idle_Fight"))
{
return;
}
SkillBase skill = skills[num];
if (!skill.MayRelease())
{
return;
}
Anim.SetTrigger("CSkill" + num);
ReleaseSkill(skill);
}
void UpdateSkillTime()
{
for (int i = 0; i < skillPanel.childCount; i++)
{
if (skills[i + 1].IsRelease)
{
continue;
}
Image image = skillPanel.GetChild(i).GetChild(0).GetComponent<Image>();
image.fillAmount = skills[i + 1].GetFillTime();
}
}
private void SwordOut(InputAction.CallbackContext context)
{
if (GameManager.gameState != GameState.Play)
{
return;
}
Anim.SetBool("SwordOut", !Anim.GetBool("SwordOut"));
}
private void Attack(InputAction.CallbackContext context)
{
if (GameManager.gameState != GameState.Play)
{
return;
}
if (EventSystem.current.IsPointerOverGameObject())
{
return;
}
if (Anim.GetCurrentAnimatorStateInfo(0).IsName("Idle_Fight"))
{
Anim.SetInteger("Att", 1);
Anim.SetTrigger("AttTrigger");
}
else
{
int num = Anim.GetInteger("Att");
if (num == 6)
{
return;
}
if (Anim.GetCurrentAnimatorStateInfo(0).IsName("Light_Attk_" + num))
{
Anim.SetInteger("Att", num + 1);
}
}
}
public void PlayerAttack(string hurt)
{
Collider[] cs = Physics.OverlapBox(attPoint.position, Vector3.one * 0.5f,
attPoint.rotation, LayerMask.GetMask("Enemy"));
if (cs.Length <= 0)
{
return;
}
int value = (int)(Att * Anim.GetInteger("Att") * 0.5f);
foreach (Collider c in cs)
{
print(value);
}
}
public void PlayerAttackHard(string hurt)
{
Collider[] cs = Physics.OverlapBox(attPoint.position, Vector3.one * 0.5f,
attPoint.rotation, LayerMask.GetMask("Enemy"));
if (cs.Length <= 0)
{
return;
}
int value = (int)(Att * Anim.GetInteger("Att") * 0.5f);
foreach (Collider c in cs)
{
print(value);
print("让敌人播放击倒特效");
}
}
private void Hold(InputAction.CallbackContext context)
{
if (GameManager.gameState != GameState.Play)
{
return;
}
if (context.phase == InputActionPhase.Canceled)
{
isHold = false;
}
else
{
isHold = true;
}
}
private void ClickNpcAndTool(InputAction.CallbackContext context)
{
//throw new NotImplementedException();
}
private void FastSpeed(InputAction.CallbackContext context)
{
if (GameManager.gameState != GameState.Play)
{
return;
}
if (Anim.GetCurrentAnimatorStateInfo(0).IsName("Run") ||
Anim.GetCurrentAnimatorStateInfo(0).IsName("Run_Inplace"))
{
if (context.phase == InputActionPhase.Canceled)
{
spdFast = 1;
}
else
{
spdFast = 2;
}
}
}
private void Rotate(InputAction.CallbackContext context)
{
if (GameManager.gameState != GameState.Play)
{
return;
}
rvalue = context.ReadValue<float>();
}
private void Jump(InputAction.CallbackContext obj){
Anim.SetTrigger("Jump");
}
private void StopMove(InputAction.CallbackContext context){
Anim.SetBool("IsRun", false);
}
private void Move(InputAction.CallbackContext context){
if (GameManager.gameState != GameState.Play) {
return;
}
Anim.SetBool("IsRun", true);
}
void Ctrl()
{
if (Anim.GetCurrentAnimatorStateInfo(0).IsName("Run") ||
Anim.GetCurrentAnimatorStateInfo(0).IsName("Run_Inplace") ||
Anim.GetCurrentAnimatorStateInfo(0).IsName("Idle")||
Anim.GetCurrentAnimatorStateInfo(0).IsName("Idle_Fight")){
float f = action.MyCtrl.Move.ReadValue<float>();
contro.Move(transform.forward * f * Time.deltaTime * spdFast * Spd);
contro.Move(transform.up * -9.8f * Time.deltaTime);
if (isHold)
{
transform.Rotate(transform.up * rvalue * 0.3f);
}
}
}
void Update()
{
if (GameManager.gameState != GameState.Play)
{
return;
}
Ctrl();
}
#region 技能
protected override void InitSkill()
{
SphereSkill thunderBombCut = new SphereSkill(this, "雷爆斩", SkillType.Magic, 3, Att * 10, -100, 20, 0.3f, 0);
skills.Add(1, thunderBombCut);
SphereSkill windCircleCut = new SphereSkill(this, "旋风斩", SkillType.Physics, 3, Att * 8, -50, 20, 0.2f, 0);
skills.Add(2, windCircleCut);
StraightSkill thunderLightCut = new StraightSkill(this, "雷光斩", SkillType.Physics, 7, 0.5f, Att * 7, -50, 20, 0.2f, 0);
skills.Add(3, thunderLightCut);
SphereSkill oneCut = new SphereSkill(this, "归一斩", SkillType.Physics, 7, Att * 7, -30, 8, 0.2f, 0);
skills.Add(4, oneCut);
StraightSkill crossCut = new StraightSkill(this, "十字斩", SkillType.Physics, 25, 0.5f, Att * 3, -40, 20, 0.2f, 0);
skills.Add(5, crossCut);
SphereSkill thunderLargeCut = new SphereSkill(this, "轰雷斩", SkillType.Magic, 7, Att * 15, -120, 25, 0.35f, 0);
skills.Add(6, thunderLargeCut);
}
#endregion
}
修改MyPlayer代码:

将技能预制体包导入:

运行即可释放技能:
按E拔刀后按F1/F2/F3/F4/F5/F6键释放技能

同一个技能不能连续释放是因为冷却,
如果不同技能释放一个后另一个释放不了是因为mp不够,
设置mp初始及mp最大容量

即可释放完F1技能后还可以释放F2/F3/F4/F5/F6技能:

相关文章:
RPG项目01_技能释放
基于“RPG项目01_新输入输出”, 修改脚本文件夹中的SkillBase脚本: using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.Events; //回复技能,魔法技能,物理技能…...
Leetcode—209.长度最小的子数组【中等】
2023每日刷题(五十六) Leetcode—209.长度最小的子数组 实现代码 class Solution { public:int minSubArrayLen(int target, vector<int>& nums) {int left 0, right 0;int ans nums.size() 1, s 0;for(; right < nums.size(); righ…...
Nacos源码解读12——Nacos中长连接的实现
短连接 VS 长连接 什么是短连接 客户端和服务器每进行一次HTTP操作,就建立一次连接,任务结束就中断连接。 长连接 客户端和服务器之间用于传输HTTP数据的TCP连接不会关闭,客户端再次访问这个服务器时,会继续使用这一条已经建立…...
k8s 安装部署
一,准备3台机器,安装docker,kubelet、kubeadm、kubectl firewall-cmd --state 使用下面命令改hostname的值:(改为k8s-master01)另外两台改为相应的名字。 172.188.32.43 hostnamectl set-hostname k8s-master01 172.188.32.4…...
TCP/IP五层(或四层)模型,IP和TCP到底在哪层?
文章目录 前言一、应用层二.传输层三.网络层:四.数据链路层五.物理层:六.OSI七层模型:1.物理层(Physical Layer):2.数据链路层(Data Link Layer):3.网络层(Ne…...
STM32串口接收不定长数据(空闲中断+DMA)
玩转 STM32 单片机,肯定离不开串口。串口使用一个称为串行通信协议的协议来管理数据传输,该协议在数据传输期间控制数据流,包括数据位数、波特率、校验位和停止位等。由于串口简单易用,在各种产品交互中都有广泛应用。 但在使用串…...
LeetCode56. Merge Intervals
文章目录 一、题目二、题解 一、题目 Given an array of intervals where intervals[i] [starti, endi], merge all overlapping intervals, and return an array of the non-overlapping intervals that cover all the intervals in the input. Example 1: Input: interva…...
【华为OD题库-083】玩牌高手-Java
题目 给定一个长度为n的整型数组,表示一个选手在n轮内可选择的牌面分数。选手基于规则选牌,请计算所有轮结束后其可以获得的最高总分数。 选择规则如下: 1.在每轮里选手可以选择获取该轮牌面,则其总分数加上该轮牌面分数,为其新的…...
ARM day3
题目:实现3盏灯的流水 代码: .text .global _start _start: 设置RCC寄存器使能 LDR R0,0X50000A28 LDR R1,[R0] ORR R1,R1,#(0X1<<4) ORR R1,R1,#(0X1<<5) STR R1,[R0]设置PE10管脚为输出模式 LDR R0,0X50006000 LDR R1,[R0] BIC R1,R1,…...
[足式机器人]Part2 Dr. CAN学习笔记-自动控制原理Ch1-2稳定性分析Stability
本文仅供学习使用 本文参考: B站:DR_CAN Dr. CAN学习笔记-自动控制原理Ch1-2稳定性分析Stability 0. 序言1. 稳定的分类2. 稳定的对象3. 稳定的系统4. 系统稳定性的讨论5. 补充内容——Transfer Function(传递函数) - nonzero Initial Condition(非零初始…...
Android Audio实战——音频链路分析(二十五)
在 Android 系统的开发过程当中,音频异常问题通常有如下几类:无声、调节不了声音、爆音、声音卡顿和声音效果异常(忽大忽小,低音缺失等)等。尤其声音效果这部分问题通常从日志上信息量较少,相对难定位根因。想要分析此类问题,便需要对声音传输链路有一定的了解,能够在链…...
PHP基础 - 常量字符串
常量 在PHP中,常量是一个简单值的标识符,定义后默认是全局变量,可以在整个运行的脚本的任何地方使用。常量由英文字母、下划线和数字组成,但数字不能作为首字母出现。 PHP中定义常量的方式是使用define()函数,其语法如下: bool define( string $name, mixed $value [,…...
Linux查看命令的绝对路径
linux查看命令的绝对路径 在Linux中,可以使用以下命令来查看命令的绝对路径: 1、which 命令名 例如,要查看chronyc命令的绝对路径,可以运行: which chronyc 2、whereis 命令名 例如,要查看chronyc命令…...
Docker build 无法解析域名
### 报错 Docker build 无法解析域名 报错:ERROR [ 2/12] RUN curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo 解决Docker build无法解析域名 # 追加到 etc/docker/daemon.json,注意JSON的格式 {"dn…...
退稿论文重复率太高会怎么样【保姆教程】
大家好,今天来聊聊退稿论文重复率太高会怎么样,希望能给大家提供一点参考。 以下是针对论文重复率高的情况,提供一些修改建议和技巧: 退稿论文重复率太高会怎么样 在学术出版领域,论文的重复率是衡量其原创性和学术诚…...
Flask 最佳实践(一)
Flask是一个轻量级而强大的Python Web框架,它的简洁性和灵活性使其成为许多开发者的首选。然而,为了确保项目的可维护性和可扩展性,我们需要遵循一些最佳实践。本文将探讨Flask中一些关键的最佳实践。 1. 项目结构 构建一个清晰的项目结构是…...
直流电和交流电
直流电(Direct Current,简称DC)和交流电(Alternating Current,简称AC)是电流的两种基本形式。 1. 直流电 直流电是指电流方向始终保持不变的电流。在直流电中,电子只能沿着一个方向移动。直流电…...
『亚马逊云科技产品测评』活动征文|基于亚马逊EC2云服务器安装Prometheus数据可视化监控
授权声明:本篇文章授权活动官方亚马逊云科技文章转发、改写权,包括不限于在 Developer Centre, 知乎,自媒体平台,第三方开发者媒体等亚马逊云科技官方渠道 亚马逊EC2云服务器(Elastic Compute Cloud)是亚马…...
15、SQL注入——Sqlmap
文章目录 一、Sqlmap简介1.1 sqlmap可以对URL干嘛?1.2 Sqlmap支持的注入技术1.3 SQLmap检测注入漏洞的流程1.4 Sqlmap的误报检测机制 二、sqlmap基本使用 一、Sqlmap简介 sqlmap使用教程 1.1 sqlmap可以对URL干嘛? 判断可注入的参数判断可以使用哪一种…...
OSPF路由协议
随着Internet技术在全球范围的飞速发展,OSPF已成为目前应用最广泛的路由协议之一。OSPF(Open Shortest Path First)路由协议是由IETF(Internet Engineering Task Force)IGP工作组提出的,是一种基于SPF算法的…...
Ubuntu系统下交叉编译openssl
一、参考资料 OpenSSL&&libcurl库的交叉编译 - hesetone - 博客园 二、准备工作 1. 编译环境 宿主机:Ubuntu 20.04.6 LTSHost:ARM32位交叉编译器:arm-linux-gnueabihf-gcc-11.1.0 2. 设置交叉编译工具链 在交叉编译之前&#x…...
DBAPI如何优雅的获取单条数据
API如何优雅的获取单条数据 案例一 对于查询类API,查询的是单条数据,比如根据主键ID查询用户信息,sql如下: select id, name, age from user where id #{id}API默认返回的数据格式是多条的,如下: {&qu…...
QT: `long long` 类型转换为 `QString` 2025.6.5
在 Qt 中,将 long long 类型转换为 QString 可以通过以下两种常用方法实现: 方法 1:使用 QString::number() 直接调用 QString 的静态方法 number(),将数值转换为字符串: long long value 1234567890123456789LL; …...
Redis数据倾斜问题解决
Redis 数据倾斜问题解析与解决方案 什么是 Redis 数据倾斜 Redis 数据倾斜指的是在 Redis 集群中,部分节点存储的数据量或访问量远高于其他节点,导致这些节点负载过高,影响整体性能。 数据倾斜的主要表现 部分节点内存使用率远高于其他节…...
技术栈RabbitMq的介绍和使用
目录 1. 什么是消息队列?2. 消息队列的优点3. RabbitMQ 消息队列概述4. RabbitMQ 安装5. Exchange 四种类型5.1 direct 精准匹配5.2 fanout 广播5.3 topic 正则匹配 6. RabbitMQ 队列模式6.1 简单队列模式6.2 工作队列模式6.3 发布/订阅模式6.4 路由模式6.5 主题模式…...
vue3 daterange正则踩坑
<el-form-item label"空置时间" prop"vacantTime"> <el-date-picker v-model"form.vacantTime" type"daterange" start-placeholder"开始日期" end-placeholder"结束日期" clearable :editable"fal…...
如何配置一个sql server使得其它用户可以通过excel odbc获取数据
要让其他用户通过 Excel 使用 ODBC 连接到 SQL Server 获取数据,你需要完成以下配置步骤: ✅ 一、在 SQL Server 端配置(服务器设置) 1. 启用 TCP/IP 协议 打开 “SQL Server 配置管理器”。导航到:SQL Server 网络配…...
DeepSeek越强,Kimi越慌?
被DeepSeek吊打的Kimi,还有多少人在用? 去年,月之暗面创始人杨植麟别提有多风光了。90后清华学霸,国产大模型六小虎之一,手握十几亿美金的融资。旗下的AI助手Kimi烧钱如流水,单月光是投流就花费2个亿。 疯…...
13.10 LangGraph多轮对话系统实战:Ollama私有部署+情感识别优化全解析
LangGraph多轮对话系统实战:Ollama私有部署+情感识别优化全解析 LanguageMentor 对话式训练系统架构与实现 关键词:多轮对话系统设计、场景化提示工程、情感识别优化、LangGraph 状态管理、Ollama 私有化部署 1. 对话训练系统技术架构 采用四层架构实现高扩展性的对话训练…...
新版NANO下载烧录过程
一、序言 搭建 Jetson 系列产品烧录系统的环境需要在电脑主机上安装 Ubuntu 系统。此处使用 18.04 LTS。 二、环境搭建 1、安装库 $ sudo apt-get install qemu-user-static$ sudo apt-get install python 搭建环境的过程需要这个应用库来将某些 NVIDIA 软件组件安装到 Je…...
