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算法的…...
浏览器访问 AWS ECS 上部署的 Docker 容器(监听 80 端口)
✅ 一、ECS 服务配置 Dockerfile 确保监听 80 端口 EXPOSE 80 CMD ["nginx", "-g", "daemon off;"]或 EXPOSE 80 CMD ["python3", "-m", "http.server", "80"]任务定义(Task Definition&…...
论文解读:交大港大上海AI Lab开源论文 | 宇树机器人多姿态起立控制强化学习框架(二)
HoST框架核心实现方法详解 - 论文深度解读(第二部分) 《Learning Humanoid Standing-up Control across Diverse Postures》 系列文章: 论文深度解读 + 算法与代码分析(二) 作者机构: 上海AI Lab, 上海交通大学, 香港大学, 浙江大学, 香港中文大学 论文主题: 人形机器人…...
VB.net复制Ntag213卡写入UID
本示例使用的发卡器:https://item.taobao.com/item.htm?ftt&id615391857885 一、读取旧Ntag卡的UID和数据 Private Sub Button15_Click(sender As Object, e As EventArgs) Handles Button15.Click轻松读卡技术支持:网站:Dim i, j As IntegerDim cardidhex, …...
【单片机期末】单片机系统设计
主要内容:系统状态机,系统时基,系统需求分析,系统构建,系统状态流图 一、题目要求 二、绘制系统状态流图 题目:根据上述描述绘制系统状态流图,注明状态转移条件及方向。 三、利用定时器产生时…...
令牌桶 滑动窗口->限流 分布式信号量->限并发的原理 lua脚本分析介绍
文章目录 前言限流限制并发的实际理解限流令牌桶代码实现结果分析令牌桶lua的模拟实现原理总结: 滑动窗口代码实现结果分析lua脚本原理解析 限并发分布式信号量代码实现结果分析lua脚本实现原理 双注解去实现限流 并发结果分析: 实际业务去理解体会统一注…...
leetcodeSQL解题:3564. 季节性销售分析
leetcodeSQL解题:3564. 季节性销售分析 题目: 表:sales ---------------------- | Column Name | Type | ---------------------- | sale_id | int | | product_id | int | | sale_date | date | | quantity | int | | price | decimal | -…...
大模型多显卡多服务器并行计算方法与实践指南
一、分布式训练概述 大规模语言模型的训练通常需要分布式计算技术,以解决单机资源不足的问题。分布式训练主要分为两种模式: 数据并行:将数据分片到不同设备,每个设备拥有完整的模型副本 模型并行:将模型分割到不同设备,每个设备处理部分模型计算 现代大模型训练通常结合…...
学校时钟系统,标准考场时钟系统,AI亮相2025高考,赛思时钟系统为教育公平筑起“精准防线”
2025年#高考 将在近日拉开帷幕,#AI 监考一度冲上热搜。当AI深度融入高考,#时间同步 不再是辅助功能,而是决定AI监考系统成败的“生命线”。 AI亮相2025高考,40种异常行为0.5秒精准识别 2025年高考即将拉开帷幕,江西、…...
关键领域软件测试的突围之路:如何破解安全与效率的平衡难题
在数字化浪潮席卷全球的今天,软件系统已成为国家关键领域的核心战斗力。不同于普通商业软件,这些承载着国家安全使命的软件系统面临着前所未有的质量挑战——如何在确保绝对安全的前提下,实现高效测试与快速迭代?这一命题正考验着…...
Reasoning over Uncertain Text by Generative Large Language Models
https://ojs.aaai.org/index.php/AAAI/article/view/34674/36829https://ojs.aaai.org/index.php/AAAI/article/view/34674/36829 1. 概述 文本中的不确定性在许多语境中传达,从日常对话到特定领域的文档(例如医学文档)(Heritage 2013;Landmark、Gulbrandsen 和 Svenevei…...
