Unity类银河恶魔城学习记录9-7 p88 Crystal instead of Clone源代码
Alex教程每一P的教程原代码加上我自己的理解初步理解写的注释,可供学习Alex教程的人参考
此代码仅为较上一P有所改变的代码
【Unity教程】从0编程制作类银河恶魔城游戏_哔哩哔哩_bilibili
Blackhole_Skill_Controller.cs
using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;public class Blackhole_Skill_Controller : MonoBehaviour
{[SerializeField] private GameObject hotKeyPrefab;[SerializeField] private List<KeyCode> KeyCodeList;private float maxSize;//最大尺寸private float growSpeed;//变大速度private float shrinkSpeed;//缩小速度private float blackholeTimer;private bool canGrow = true;//是否可以变大private bool canShrink;//缩小private bool canCreateHotKeys = true;专门控制后面进入的没法生成热键private bool cloneAttackReleased;private bool playerCanDisaper = true;private int amountOfAttacks = 4;private float cloneAttackCooldown = .3f;private float cloneAttackTimer;private List<Transform> targets = new List<Transform>();private List<GameObject> createdHotKey = new List<GameObject>();public bool playerCanExitState { get; private set; }public void SetupBlackhole(float _maxSize,float _growSpeed,float _shrinkSpeed,int _amountOfAttacks,float _cloneAttackCooldown,float _blackholeDuration){maxSize = _maxSize;growSpeed = _growSpeed;shrinkSpeed = _shrinkSpeed;amountOfAttacks = _amountOfAttacks;cloneAttackCooldown = _cloneAttackCooldown;blackholeTimer = _blackholeDuration;if (SkillManager.instance.clone.crystalInsteadOfClone)//释放水晶时角色不消失playerCanDisaper = false;}private void Update(){blackholeTimer -= Time.deltaTime;cloneAttackTimer -= Time.deltaTime;if(blackholeTimer <= 0){blackholeTimer = Mathf.Infinity;//防止重复检测if (targets.Count > 0)//只有有target才释放攻击{ReleaseCloneAttack();//释放攻击}elseFinishBlackholeAbility();//缩小黑洞}if (Input.GetKeyDown(KeyCode.R)&& targets.Count > 0){ReleaseCloneAttack();}CloneAttackLogic();if (canGrow && !canShrink){//这是控制物体大小的参数transform.localScale = Vector2.Lerp(transform.localScale, new Vector2(maxSize, maxSize), growSpeed * Time.deltaTime);//类似MoveToward,不过是放大到多少大小 https://docs.unity3d.com/cn/current/ScriptReference/Vector2.Lerp.html}if (canShrink){transform.localScale = Vector2.Lerp(transform.localScale, new Vector2(0, 0), shrinkSpeed * Time.deltaTime);if (transform.localScale.x <= 1f){Destroy(gameObject);}}}//释放技能private void ReleaseCloneAttack(){cloneAttackReleased = true;canCreateHotKeys = false;DestroyHotKeys();if(playerCanDisaper){playerCanDisaper = false;PlayerManager.instance.player.MakeTransprent(true);}}private void CloneAttackLogic(){if (cloneAttackTimer < 0 && cloneAttackReleased&&amountOfAttacks>0){cloneAttackTimer = cloneAttackCooldown;int randomIndex = Random.Range(0, targets.Count);//限制攻击次数和设置攻击偏移量float _offset;if (Random.Range(0, 100) > 50)_offset = 1.5f;else_offset = -1.5f;if (SkillManager.instance.clone.crystalInsteadOfClone){SkillManager.instance.crystal.CreateCrystal(); //让生成克隆变成生成水晶SkillManager.instance.crystal.CurrentCrystalChooseRandomTarget(); //让黑洞里替换出来的水晶能够随机选择目标}else{SkillManager.instance.clone.CreateClone(targets[randomIndex], new Vector3(_offset, 0, 0));}amountOfAttacks--;if (amountOfAttacks <= 0){Invoke("FinishBlackholeAbility", 0.5f);}}}//完成黑洞技能后private void FinishBlackholeAbility(){DestroyHotKeys();canShrink = true;cloneAttackReleased = false;playerCanExitState = true;}private void OnTriggerEnter2D(Collider2D collision){if(collision.GetComponent<Enemy>()!=null){collision.GetComponent<Enemy>().FreezeTime(true);CreateHotKey(collision);}}private void OnTriggerExit2D(Collider2D collision){if (collision.GetComponent<Enemy>() != null){collision.GetComponent<Enemy>().FreezeTime(false);}}//创建QTE函数private void CreateHotKey(Collider2D collision){if(KeyCodeList.Count == 0)//当所有的KeyCode都被去除,就不在创建实例{return;}if(!canCreateHotKeys)//这是当角色已经开大了,不在创建实例{return;}//创建实例GameObject newHotKey = Instantiate(hotKeyPrefab, collision.transform.position + new Vector3(0, 2), Quaternion.identity);//将实例添加进列表createdHotKey.Add(newHotKey);//随机KeyCode传给HotKey,并且传过去一个毁掉一个KeyCode choosenKey = KeyCodeList[Random.Range(0, KeyCodeList.Count)];KeyCodeList.Remove(choosenKey);Blackhole_Hotkey_Controller newHotKeyScript = newHotKey.GetComponent<Blackhole_Hotkey_Controller>();newHotKeyScript.SetupHotKey(choosenKey, collision.transform, this);}//添加点击hotkey后对应的敌人进入敌人列表public void AddEnemyToList(Transform _myEnemy){targets.Add(_myEnemy);}//销毁Hotkeyprivate void DestroyHotKeys(){if(createdHotKey.Count <= 0){return;}for (int i = 0; i < createdHotKey.Count; i++){Destroy(createdHotKey[i]); }}}
Blackhole_Skill.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;public class Blackhole_Skill : Skill
{[SerializeField]private float maxSize;//最大尺寸[SerializeField] private float growSpeed;//变大速度[SerializeField] private float shrinkSpeed;//缩小速度[SerializeField] private GameObject blackholePrefab;[Space][SerializeField] private float blackholeDuration;[SerializeField] int amountOfAttacks = 4;[SerializeField] float cloneAttackCooldown = .3f;Blackhole_Skill_Controller currentBlackhole;public override bool CanUseSkill(){return base.CanUseSkill();}public override void UseSkill(){base.UseSkill();GameObject newBlackhole = Instantiate(blackholePrefab,player.transform.position,Quaternion.identity);currentBlackhole = newBlackhole.GetComponent<Blackhole_Skill_Controller>();currentBlackhole.SetupBlackhole(maxSize,growSpeed,shrinkSpeed,amountOfAttacks,cloneAttackCooldown,blackholeDuration);}protected override void Start(){base.Start();}protected override void Update(){base.Update();}public bool SkillCompleted(){if(currentBlackhole == null)return false;if (currentBlackhole.playerCanExitState){return true;}else{return false;}}//把随机敌人半径改成黑洞半径的一半就行public float GetBlackholeRadius(){return maxSize / 2;}
}
Clone_Skill.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;public class Crystal_Skill : Skill
{[SerializeField] private GameObject crystalPrefab;[SerializeField] private float crystalDuration;using System.Collections;
using System.Collections.Generic;
using UnityEngine;public class Clone_Skill : Skill
{[Header("Clone Info")][SerializeField] private GameObject clonePrefab;//克隆原型[SerializeField] private float cloneDuration;//克隆持续时间[SerializeField] private bool canAttack;// 判断是否可以攻击[SerializeField] private bool createCloneOnDashStart;[SerializeField] private bool createCloneOnDashOver;[SerializeField] private bool canCreateCloneOnCounterAttack;[Header("Clone can duplicate")][SerializeField] private bool canDuplicateClone;[SerializeField] private float chanceToDuplicate;[Header("Crystal instead of clone")]public bool crystalInsteadOfClone;public void CreateClone(Transform _clonePosition,Vector3 _offset)//传入克隆位置{if(crystalInsteadOfClone){SkillManager.instance.crystal.CreateCrystal();return;}//让所有的生成克隆的技能都变成生成水晶GameObject newClone = Instantiate(clonePrefab);//创建新的克隆//克隆 original 对象并返回克隆对象。//https://docs.unity3d.com/cn/current/ScriptReference/Object.Instantiate.htmlnewClone.GetComponent<Clone_Skill_Controller>().SetupClone(_clonePosition,cloneDuration,canAttack,_offset,FindClosestEnemy(newClone.transform),canDuplicateClone,chanceToDuplicate);//调试clone的位置,同时调试克隆持续时间 //Controller绑在克隆原型上的,所以用GetComponent }//让冲刺留下来的克隆在开始和结束各有一个public void CreateCloneOnDashStart(){if (createCloneOnDashStart)CreateClone(player.transform, Vector3.zero);}public void CreateCloneOnDashOver(){if(createCloneOnDashOver)CreateClone(player.transform, Vector3.zero);}//反击后产生一个克隆被刺敌人public void CanCreateCloneOnCounterAttack(Transform _enemyTransform){if (canCreateCloneOnCounterAttack)StartCoroutine(CreateCloneWithDelay(_enemyTransform, new Vector3(1 * player.facingDir, 0, 0)));}//整个延迟生成private IEnumerator CreateCloneWithDelay(Transform _enemyTransform, Vector3 _offset){yield return new WaitForSeconds(.4f);CreateClone(_enemyTransform, _offset);}
}private GameObject currentCrystal;[Header("Crystal mirage")][SerializeField] private bool cloneInsteadOfCrystal;[Header("Explosive crystal")][SerializeField] private bool canExplode;[Header("Moving crystal")][SerializeField] private bool canMoveToEnemy;[SerializeField] private float moveSpeed;[Header("Multi stacking crystal")][SerializeField] private bool canUseMultiStacks;[SerializeField] private int amountOfStacks;[SerializeField] private float multiStackCooldown;[SerializeField] private List<GameObject> crystalLeft = new List<GameObject>();//水晶列表[SerializeField] private float useTimeWindow;public override bool CanUseSkill(){return base.CanUseSkill();}public override void UseSkill(){base.UseSkill();if (CanUseMultiCrystal())return;if (currentCrystal == null){CreateCrystal();}else{//限制玩家在水晶可以移动时瞬移if (canMoveToEnemy)return;//爆炸前与角色交换位置Vector2 playerPos = player.transform.position;player.transform.position = currentCrystal.transform.position;currentCrystal.transform.position = playerPos;//水晶互换时在水晶处出现clone,水晶消失if (cloneInsteadOfCrystal){SkillManager.instance.clone.CreateClone(currentCrystal.transform,Vector3.zero);Destroy(currentCrystal);}else{currentCrystal.GetComponent<Crystal_Skill_Controller>()?.FinishCrystal();} }}public void CreateCrystal(){currentCrystal = Instantiate(crystalPrefab, player.transform.position, Quaternion.identity);Crystal_Skill_Controller currentCrystalScripts = currentCrystal.GetComponent<Crystal_Skill_Controller>();currentCrystalScripts.SetupCrystal(crystalDuration, canExplode, canMoveToEnemy, moveSpeed, FindClosestEnemy(currentCrystal.transform));}public void CurrentCrystalChooseRandomTarget() => currentCrystal.GetComponent<Crystal_Skill_Controller>().ChooseRandomEnemy();protected override void Start(){base.Start();}protected override void Update(){base.Update();}private bool CanUseMultiCrystal()//将List里的东西实例化函数{if(canUseMultiStacks){if(crystalLeft.Count > 0&&cooldownTimer<0){if(crystalLeft.Count == amountOfStacks){Invoke("ResetAbility", useTimeWindow);// 设置自动补充水晶函数}cooldown = 0;GameObject crystalToSpawn = crystalLeft[crystalLeft.Count - 1];GameObject newCrystal = Instantiate(crystalToSpawn, player.transform.position, Quaternion.identity);crystalLeft.Remove(crystalToSpawn);newCrystal.GetComponent<Crystal_Skill_Controller>().SetupCrystal(crystalDuration, canExplode, canMoveToEnemy, moveSpeed, FindClosestEnemy(newCrystal.transform));//当水晶发射完设置冷却时间和使用补充水晶if (crystalLeft.Count<=0){cooldown = multiStackCooldown;RefilCrystal();}}return true;}return false;}private void RefilCrystal()//给List填充Prefab函数{int amountToAdd = amountOfStacks - crystalLeft.Count;for (int i = 0;i < amountToAdd; i++){crystalLeft.Add(crystalPrefab);}}private void ResetAbility()//自动补充水晶函数{if (cooldownTimer > 0)return;cooldown = multiStackCooldown;RefilCrystal();}
}
Crystal_Skill_Controller
using System.Collections;
using System.Collections.Generic;
using UnityEngine;public class Crystal_Skill_Controller : MonoBehaviour
{private Animator anim => GetComponent<Animator>();private CircleCollider2D cd => GetComponent<CircleCollider2D>();private float crystalExitTimer;private bool canExplode;private bool canMove;private float moveSpeed;private bool canGrow;private float growSpeed = 5;private Transform closestTarget;[SerializeField] private LayerMask whatIsEnemy;public void SetupCrystal(float _crystalDuration,bool _canExplode,bool _canMove,float _moveSpeed,Transform _closestTarget){crystalExitTimer = _crystalDuration;canExplode = _canExplode;canMove = _canMove;moveSpeed = _moveSpeed;closestTarget = _closestTarget;}//让黑洞里替换出来的水晶能够随机选择目标public void ChooseRandomEnemy()//Ctrl里写函数,让最近敌人改成列表里的随机敌人{float radius = SkillManager.instance.blackhole.GetBlackholeRadius();//把随机敌人半径改成黑洞半径的一半就行Collider2D[] colliders = Physics2D.OverlapCircleAll(transform.position, 50, whatIsEnemy);if(colliders.Length >= 0){closestTarget = colliders[Random.Range(0,colliders.Length)].transform;Debug.Log("Give Random");}}private void Update(){crystalExitTimer -= Time.deltaTime;if (crystalExitTimer < 0){FinishCrystal();}//可以运动就靠近敌人后爆炸,范围小于1时爆炸,并且爆炸时不能移动if (canMove){//修复攻击范围内没有敌人会报错的bugif(closestTarget != null){transform.position = Vector2.MoveTowards(transform.position, closestTarget.position, moveSpeed * Time.deltaTime);if (Vector2.Distance(transform.position, closestTarget.position) < 1){FinishCrystal();canMove = false;}}elsetransform.position = Vector2.MoveTowards(transform.position, transform.position+new Vector3(5,0,0), moveSpeed * Time.deltaTime);}//爆炸瞬间变大if (canGrow)transform.localScale = Vector2.Lerp(transform.localScale, new Vector2(3, 3), growSpeed * Time.deltaTime);}//爆炸造成伤害private void AnimationExplodeEvent(){Collider2D[] colliders = Physics2D.OverlapCircleAll(transform.position, cd.radius);foreach(var hit in colliders){if (hit.GetComponent<Enemy>() != null)hit.GetComponent<Enemy>().Damage();}}public void FinishCrystal(){if (canExplode){canGrow = true;anim.SetBool("Explode",true);}else{SelfDestory();}}public void SelfDestory() => Destroy(gameObject);
}
Crystal_Skill
using System.Collections;
using System.Collections.Generic;
using UnityEngine;public class Crystal_Skill : Skill
{[SerializeField] private GameObject crystalPrefab;[SerializeField] private float crystalDuration;private GameObject currentCrystal;[Header("Crystal mirage")][SerializeField] private bool cloneInsteadOfCrystal;[Header("Explosive crystal")][SerializeField] private bool canExplode;[Header("Moving crystal")][SerializeField] private bool canMoveToEnemy;[SerializeField] private float moveSpeed;[Header("Multi stacking crystal")][SerializeField] private bool canUseMultiStacks;[SerializeField] private int amountOfStacks;[SerializeField] private float multiStackCooldown;[SerializeField] private List<GameObject> crystalLeft = new List<GameObject>();//水晶列表[SerializeField] private float useTimeWindow;public override bool CanUseSkill(){return base.CanUseSkill();}public override void UseSkill(){base.UseSkill();if (CanUseMultiCrystal())return;if (currentCrystal == null){CreateCrystal();}else{//限制玩家在水晶可以移动时瞬移if (canMoveToEnemy)return;//爆炸前与角色交换位置Vector2 playerPos = player.transform.position;player.transform.position = currentCrystal.transform.position;currentCrystal.transform.position = playerPos;//水晶互换时在水晶处出现clone,水晶消失if (cloneInsteadOfCrystal){SkillManager.instance.clone.CreateClone(currentCrystal.transform,Vector3.zero);Destroy(currentCrystal);}else{currentCrystal.GetComponent<Crystal_Skill_Controller>()?.FinishCrystal();} }}public void CreateCrystal(){currentCrystal = Instantiate(crystalPrefab, player.transform.position, Quaternion.identity);Crystal_Skill_Controller currentCrystalScripts = currentCrystal.GetComponent<Crystal_Skill_Controller>();currentCrystalScripts.SetupCrystal(crystalDuration, canExplode, canMoveToEnemy, moveSpeed, FindClosestEnemy(currentCrystal.transform));}public void CurrentCrystalChooseRandomTarget() => currentCrystal.GetComponent<Crystal_Skill_Controller>().ChooseRandomEnemy();protected override void Start(){base.Start();}protected override void Update(){base.Update();}private bool CanUseMultiCrystal()//将List里的东西实例化函数{if(canUseMultiStacks){if(crystalLeft.Count > 0&&cooldownTimer<0){if(crystalLeft.Count == amountOfStacks){Invoke("ResetAbility", useTimeWindow);// 设置自动补充水晶函数}cooldown = 0;GameObject crystalToSpawn = crystalLeft[crystalLeft.Count - 1];GameObject newCrystal = Instantiate(crystalToSpawn, player.transform.position, Quaternion.identity);crystalLeft.Remove(crystalToSpawn);newCrystal.GetComponent<Crystal_Skill_Controller>().SetupCrystal(crystalDuration, canExplode, canMoveToEnemy, moveSpeed, FindClosestEnemy(newCrystal.transform));//当水晶发射完设置冷却时间和使用补充水晶if (crystalLeft.Count<=0){cooldown = multiStackCooldown;RefilCrystal();}}return true;}return false;}private void RefilCrystal()//给List填充Prefab函数{int amountToAdd = amountOfStacks - crystalLeft.Count;for (int i = 0;i < amountToAdd; i++){crystalLeft.Add(crystalPrefab);}}private void ResetAbility()//自动补充水晶函数{if (cooldownTimer > 0)return;cooldown = multiStackCooldown;RefilCrystal();}
}
相关文章:
Unity类银河恶魔城学习记录9-7 p88 Crystal instead of Clone源代码
Alex教程每一P的教程原代码加上我自己的理解初步理解写的注释,可供学习Alex教程的人参考 此代码仅为较上一P有所改变的代码 【Unity教程】从0编程制作类银河恶魔城游戏_哔哩哔哩_bilibili Blackhole_Skill_Controller.cs using System.Collections; using System…...
导出RWKV模型为onnx
测试模型: https://huggingface.co/RWKV/rwkv-5-world-3b 导出前对modeling_rwkv5.py进行一个修改: # out out.reshape(B * T, H * S) out out.reshape(B * T, H * S, 1) # <<--- modified out F.group_norm(out, nu…...
【LeetCode】整数转罗马数字 C语言 | 此刻,已成艺术(bushi)
Problem: 12. 整数转罗马数字 文章目录 思路解题方法复杂度Code 思路 暴力破解 转换 解题方法 由思路可知 复杂度 时间复杂度: O ( n ) O(n) O(n) 空间复杂度: O ( 1 ) O(1) O(1) Code char* intToRoman(int num) {char *s (char*)malloc(sizeof(char)*4000), *p s;while(…...
移动App开发常见的三种模式:原生应用、H5移动应用、混合模式应用
引言 在移动应用市场的迅猛发展中,移动App开发正日益成为技术创新和用户体验提升的焦点。对于开发者而言,选择适合自己项目的开发模式成为至关重要的决策。本文将探究移动App开发的三种常见模式:原生应用、H5移动应用和混合模式应用。这三种…...
k8s Secret配置资源,ConfigMap 存储配置信资源管理详解
目录 一、Secret 概念 三种Secret类型 pod三种使用secret的方式 应用场景:凭据: 二、 示例 2.1、用kubectl create secret命令创建 Secret 创建Secret: 查看Secret列表: 描述Secret: 2.2、用 base64 编码&…...
POS 之 最终确定性
Gasper Casper 是一种能将特定区块更新为 最终确定 状态的机制,使网络的新加入者确信他们正在同步规范链。当区块链出现多个分叉时,分叉选择算法使用累计投票来确保节点可以轻松选择正确的分叉。 最终确定性 最终确定性是某些区块的属性,意味…...
Vue快速开发一个主页
前言 这里讲述我们如何快速利用Vue脚手架快速搭建一个主页。 页面布局 el-container / el-header / el-aside / el-main:https://element.eleme.cn/#/zh-CN/component/container <el-container><el-header style"background-color: #4c535a"…...
Java SE入门及基础(33)
final 修饰符 1. 应用范围 final 修饰符应该使用在类、变量以及方法上 2. final 修饰类 Note that you can also declare an entire class final. A class that is declared final cannot be subclassed. This is particularly useful, for example, when creating an imm…...
ChatGPT逐步进入留学圈但并不能解决留学规划的问题
2022 年底,一个能像人类一样对话的AI软件ChatGPT,在5天内突破一百万用户,风靡全球,如今用户已达1.8亿。 四个月后,ChatGPT进化为GPT4版本。该版本逻辑、数学推理能力卓越。拿留美标准化考试举例,GPT4能够在…...
WebGL之灯光使用解析
在使用灯光之前,首先我们需要了解,与定义更广泛的 OpenGL 不同,WebGL 并没有继承 OpenGL 中灯光的支持。所以你只能由自己完全得控制灯光。幸运得是,这也并不是很难,本文接下来就会介绍完成灯光的基础。 在 3D 空间中…...
【Spring云原生系列】SpringBoot+Spring Cloud Stream:消息驱动架构(MDA)解析,实现异步处理与解耦合
🎉🎉欢迎光临,终于等到你啦🎉🎉 🏅我是苏泽,一位对技术充满热情的探索者和分享者。🚀🚀 🌟持续更新的专栏《Spring 狂野之旅:从入门到入魔》 &a…...
PostgreSQL索引篇 | TSearch2 全文搜索
PostgreSQL版本为8.4.1 (本文为《PostgreSQL数据库内核分析》一书的总结笔记,需要电子版的可私信我) 索引篇: PostgreSQL索引篇 | BTreePostgreSQL索引篇 | GiST索引PostgreSQL索引篇 | Hash索引PostgreSQL索引篇 | GIN索引 (倒排…...
SpringMVC 中的常用注解和用法
⭐ 作者:小胡_不糊涂 🌱 作者主页:小胡_不糊涂的个人主页 📀 收录专栏:JavaEE 💖 持续更文,关注博主少走弯路,谢谢大家支持 💖 注解 1. MVC定义2. 注解2.1 RequestMappin…...
智慧城市中的数据力量:大数据与AI的应用
目录 一、引言 二、大数据与AI技术的融合 三、大数据与AI在智慧城市中的应用 1、智慧交通 2、智慧环保 3、智慧公共安全 4、智慧公共服务 四、大数据与AI在智慧城市中的价值 1、提高城市管理的效率和水平 2、优化城市资源的配置和利用 3、提升市民的生活质量和幸福感…...
德人合科技|天锐绿盾加密软件——数据防泄漏系统
德人合科技是一家专注于提供企业级信息安全解决方案的服务商,提供的天锐绿盾加密软件是一款专为企业设计的数据安全防护产品,主要用于解决企事业单位内部敏感数据的防泄密问题。 www.drhchina.com PC端: https://isite.baidu.com/site/wjz012…...
C语言---单身狗问题
1.单身狗初阶 这个题目就是数组里面有一串数字,都是成对存在的,只有一个数字只出现了一次,请你找出来 (1)异或是满足交换律的,两个相同的数字异或之后是0; (2)让0和每个…...
一次gitlab 502故障解决过程
通过top,发现prometheus进程占用CPU接近100%,这肯定有点异常。gitlab-ctl tail prometheus 发现有报错的情况,提示空间不足。暂时不管空间的问题。 2024-03-07_05:48:09.01515 ts2024-03-07T05:48:09.014Z callermain.go:1116 levelerror err"open…...
Xilinx 7系列 FPGA硬件知识系列(一)——FPGA选型参考
目录 1.1 Xilinx-7系列产品的工艺级别 编辑1.2 Xilinx-7系列产品的特点 1.2.1 Spartan-7系列 1.2.2 Artix-7系列 1.2.3 Kintex-7系列 1.2.4 Virtex-7系列 1.3 Xilinx-7系列FPGA对比 1.3.1 DSP资源柱状图 1.3.2 Block RAM资源柱状图 1.3.3 高速串行收…...
【C++从练气到飞升】02---初识类与对象
🎈个人主页:库库的里昂 ✨收录专栏:C从练气到飞升 🎉鸟欲高飞先振翅,人求上进先读书。 目录 ⛳️推荐 一、面向过程和面向对象初步认识 二、类的引用 1. C语言版 2. C版 三、类的定义 类的两种定义方式ÿ…...
探秘分布式神器RMI:原理、应用与前景分析(一)
本系列文章简介: 本系列文章将深入探究RMI远程调用的原理、应用及未来的发展趋势。首先,我们会详细介绍RMI的工作原理和基本流程,解析其在分布式系统中的核心技术。随后,我们将探讨RMI在各个领域的应用,包括分布式计算…...
dedecms 织梦自定义表单留言增加ajax验证码功能
增加ajax功能模块,用户不点击提交按钮,只要输入框失去焦点,就会提前提示验证码是否正确。 一,模板上增加验证码 <input name"vdcode"id"vdcode" placeholder"请输入验证码" type"text&quo…...
基础测试工具使用经验
背景 vtune,perf, nsight system等基础测试工具,都是用过的,但是没有记录,都逐渐忘了。所以写这篇博客总结记录一下,只要以后发现新的用法,就记得来编辑补充一下 perf 比较基础的用法: 先改这…...
多模态图像修复系统:基于深度学习的图片修复实现
多模态图像修复系统:基于深度学习的图片修复实现 1. 系统概述 本系统使用多模态大模型(Stable Diffusion Inpainting)实现图像修复功能,结合文本描述和图片输入,对指定区域进行内容修复。系统包含完整的数据处理、模型训练、推理部署流程。 import torch import numpy …...
BLEU评分:机器翻译质量评估的黄金标准
BLEU评分:机器翻译质量评估的黄金标准 1. 引言 在自然语言处理(NLP)领域,衡量一个机器翻译模型的性能至关重要。BLEU (Bilingual Evaluation Understudy) 作为一种自动化评估指标,自2002年由IBM的Kishore Papineni等人提出以来,…...
Vue ③-生命周期 || 脚手架
生命周期 思考:什么时候可以发送初始化渲染请求?(越早越好) 什么时候可以开始操作dom?(至少dom得渲染出来) Vue生命周期: 一个Vue实例从 创建 到 销毁 的整个过程。 生命周期四个…...
在树莓派上添加音频输入设备的几种方法
在树莓派上添加音频输入设备可以通过以下步骤完成,具体方法取决于设备类型(如USB麦克风、3.5mm接口麦克风或HDMI音频输入)。以下是详细指南: 1. 连接音频输入设备 USB麦克风/声卡:直接插入树莓派的USB接口。3.5mm麦克…...
Vue 模板语句的数据来源
🧩 Vue 模板语句的数据来源:全方位解析 Vue 模板(<template> 部分)中的表达式、指令绑定(如 v-bind, v-on)和插值({{ }})都在一个特定的作用域内求值。这个作用域由当前 组件…...
【Veristand】Veristand环境安装教程-Linux RT / Windows
首先声明,此教程是针对Simulink编译模型并导入Veristand中编写的,同时需要注意的是老用户编译可能用的是Veristand Model Framework,那个是历史版本,且NI不会再维护,新版本编译支持为VeriStand Model Generation Suppo…...
上位机开发过程中的设计模式体会(1):工厂方法模式、单例模式和生成器模式
简介 在我的 QT/C 开发工作中,合理运用设计模式极大地提高了代码的可维护性和可扩展性。本文将分享我在实际项目中应用的三种创造型模式:工厂方法模式、单例模式和生成器模式。 1. 工厂模式 (Factory Pattern) 应用场景 在我的 QT 项目中曾经有一个需…...
Linux操作系统共享Windows操作系统的文件
目录 一、共享文件 二、挂载 一、共享文件 点击虚拟机选项-设置 点击选项,设置文件夹共享为总是启用,点击添加,可添加需要共享的文件夹 查询是否共享成功 ls /mnt/hgfs 如果显示Download(这是我共享的文件夹)&…...
