Unity类银河恶魔城学习记录10-4 p92 Death of entity源代码

Alex教程每一P的教程原代码加上我自己的理解初步理解写的注释,可供学习Alex教程的人参考
此代码仅为较上一P有所改变的代码

【Unity教程】从0编程制作类银河恶魔城游戏_哔哩哔哩_bilibili

PlayerStat
using System.Collections;
using System.Collections.Generic;
using UnityEngine;public class PlayerStat : CharacterStats
{private Player player;protected override void Start(){player = GetComponent<Player>();base.Start();}public override void DoDamage(CharacterStats _targetStats){base.DoDamage(_targetStats);}protected override void TakeDamage(int _damage){base.TakeDamage(_damage);player.DamageEffect();}protected override void Die(){base.Die();player.Die();}
}

EnemyStat
using System.Collections;
using System.Collections.Generic;
using UnityEngine;public class EnemyStat : CharacterStats
{private Enemy enemy;public override void DoDamage(CharacterStats _targetStats){base.DoDamage(_targetStats);}protected override void Die(){base.Die();enemy.Die();}protected override void Start(){enemy = GetComponent<Enemy>();base.Start();}protected override void TakeDamage(int _damage){base.TakeDamage(_damage);enemy.DamageEffect();}
}
Entity.cs
 using System.Collections;
using System.Collections.Generic;
using UnityEngine;public class Entity : MonoBehaviour
{[Header("Knockback info")][SerializeField] protected Vector2 knockbackDirection;//被击打后的速度信息[SerializeField] protected float knockbackDuration;//被击打的时间protected bool isKnocked;//此值通过卡住SetVelocity函数的方式用来阻止当一个角色被攻击时,会乱动的情况[Header("Collision Info")]public Transform attackCheck;//transform类,代表的时物体的位置,用来控制攻击检测的位置public float attackCheckRadius;//检测半径[SerializeField] protected Transform groundCheck;//transform类,代表的时物体的位置,后面会来定位子组件的位置    [SerializeField] protected float groundCheckDistance;[SerializeField] protected Transform wallCheck;//transform类,代表的时物体的位置,后面会来定位子组件的位置    [SerializeField] protected float wallCheckDistance;[SerializeField] protected LayerMask whatIsGround;//LayerMask类,与Raycast配合,https://docs.unity3d.com/cn/current/ScriptReference/Physics.Raycast.html#region 定义Unity组件public SpriteRenderer sr { get; private set; }public Animator anim { get; private set; }//这样才能配合着拿到自己身上的animator的控制权public Rigidbody2D rb { get; private set; }//配合拿到身上的Rigidbody2D组件控制权public EntityFX fx { get; private set; }//拿到EntityFXpublic CharacterStats stats { get; private set; }public CapsuleCollider2D cd { get; private set; }#endregionpublic int facingDir { get; private set; } = 1;protected bool facingRight = true;//判断是否朝右protected virtual void Awake(){}protected virtual void Start(){anim = GetComponentInChildren<Animator>();//拿到自己子组件身上的animator的控制权sr = GetComponentInChildren<SpriteRenderer>();fx = GetComponent<EntityFX>();拿到的组件上的EntityFX控制权rb = GetComponent<Rigidbody2D>();stats = GetComponent<CharacterStats>();cd = GetComponent<CapsuleCollider2D>();}protected virtual void Update(){}protected virtual void Exit(){}public virtual void DamageEffect(){fx.StartCoroutine("FlashFX");//IEnumertor本质就是将一个函数分块执行,只有满足某些条件才能执行下一段代码,此函数有StartCoroutine调用//https://www.zhihu.com/tardis/bd/art/504607545?source_id=1001StartCoroutine("HitKnockback");//调用被击打后产生后退效果的函数Debug.Log(gameObject.name+"was damaged");}protected virtual IEnumerator HitKnockback(){isKnocked = true;//此值通过卡住SetVelocity函数的方式用来阻止当一个角色被攻击时,会乱动的情况rb.velocity = new Vector2(knockbackDirection.x * -facingDir, knockbackDirection.y);yield return new WaitForSeconds(knockbackDuration);isKnocked = false;}//被击打后产生后退效果的函数#region 速度函数Velocitypublic virtual void SetZeroVelocity(){if(isKnocked){return;}rb.velocity = new Vector2(0, 0);}//设置速度为0函数public virtual void SetVelocity(float _xVelocity, float _yVelocity){if(isKnocked)return;此值通过卡住SetVelocity函数的方式用来阻止当一个角色被攻击时,会乱动的情况rb.velocity = new Vector2(_xVelocity, _yVelocity);//将rb的velocity属性设置为对应的想要的二维向量。因为2D游戏的速度就是二维向量FlipController(_xVelocity);//在其他设置速度的时候调用翻转控制器}//控制速度的函数,此函数在其他State中可能会使用,但仅能通过player.SeVelocity调用#endregion#region 翻转函数Flippublic virtual void Flip(){facingDir = facingDir * -1;facingRight = !facingRight;transform.Rotate(0, 180, 0);//旋转函数,transform不需要额外定义,因为他是自带的}//翻转函数public virtual void FlipController(float _x)//目前设置x,目的时能在空中时也能转身{if (_x > 0 && !facingRight)//当速度大于0且没有朝右时,翻转{Flip();}else if (_x < 0 && facingRight){Flip();}}#endregion#region 碰撞函数Collisionpublic virtual bool IsGroundDetected(){return Physics2D.Raycast(groundCheck.position, Vector2.down, groundCheckDistance, whatIsGround);}//通过RayCast检测是否挨着地面,https://docs.unity3d.com/cn/current/ScriptReference/Physics2D.Raycast.html//xxxxxxxx()   => xxxxxxxx  == xxxxxxxxxx() return xxxxxxxxx;public virtual bool IsWallDetected(){return Physics2D.Raycast(wallCheck.position, Vector2.right * facingDir, wallCheckDistance, whatIsGround);}//通过RayCast检测是否挨着地面,https://docs.unity3d.com/cn/current/ScriptReference/Physics2D.Raycast.html//xxxxxxxx()   => xxxxxxxx  == xxxxxxxxxx() return xxxxxxxxx;protected virtual void OnDrawGizmos(){Gizmos.DrawLine(groundCheck.position, new Vector3(groundCheck.position.x, groundCheck.position.y - groundCheckDistance));//绘制一条从 from(前面的) 开始到 to(后面的) 的线。Gizmos.DrawLine(wallCheck.position, new Vector3(wallCheck.position.x + wallCheckDistance, wallCheck.position.y));//绘制一条从 from(前面的) 开始到 to(后面的) 的线。Gizmos.DrawWireSphere(attackCheck.position, attackCheckRadius);//https://docs.unity3d.com/2022.3/Documentation/ScriptReference/Gizmos.DrawWireSphere.html//绘制具有中心和半径的线框球体。}//画图函数#endregionpublic void MakeTransprent(bool isClear){if (isClear)sr.color = Color.clear;elsesr.color = Color.white;}public virtual void Die(){}
}
Player.cs
using System.Collections;
using System.Collections.Generic;
using Unity.VisualScripting;
using UnityEngine;public class Player : Entity
{[Header("Attack Details")]public Vector2[] attackMovement;//每个攻击时获得的速度组public float counterAttackDuration = .2f;public bool isBusy{ get; private set; }//防止在攻击间隔中进入move//[Header("Move Info")]public float moveSpeed;//定义速度,与xInput相乘控制速度的大小public float jumpForce;public float swordReturnImpact;//在player里设置swordReturnImpact作为击退的参数[Header("Dash Info")][SerializeField] private float dashCooldown;private float dashUsageTimer;//为dash设置冷却时间,在一定时间内不能连续使用public float dashSpeed;//冲刺速度public float dashDuration;//持续时间public float dashDir { get; private set; }#region 定义Statespublic PlayerStateMachine stateMachine { get; private set; }public PlayerIdleState idleState { get; private set; }public PlayerMoveState moveState { get; private set; }public PlayerJumpState jumpState { get; private set; }public PlayerAirState airState { get; private set; }public PlayerDashState dashState { get; private set; }public PlayerWallSlideState wallSlide { get; private set; }public PlayerWallJumpState wallJump { get; private set; }public PlayerDeadState deadState { get; private set; }public PlayerPrimaryAttackState primaryAttack { get; private set; }public PlayerCounterAttackState counterAttack { get; private set; }public PlayerAimSwordState aimSword { get; private set; }public PlayerCatchSwordState catchSword { get; private set; }public PlayerBlackholeState blackhole { get; private set; }public SkillManager skill { get; private set; }public GameObject sword{ get; private set; }//声明sword#endregionprotected override void Awake(){base.Awake();stateMachine = new PlayerStateMachine();//通过构造函数,在构造时传递信息idleState = new PlayerIdleState(this, stateMachine, "Idle");moveState = new PlayerMoveState(this, stateMachine, "Move");jumpState = new PlayerJumpState(this, stateMachine, "Jump");airState = new PlayerAirState(this, stateMachine, "Jump");dashState = new PlayerDashState(this, stateMachine, "Dash");wallSlide = new PlayerWallSlideState(this, stateMachine, "WallSlide");wallJump = new PlayerWallJumpState(this, stateMachine, "Jump");//wallJump也是Jump动画deadState = new PlayerDeadState(this, stateMachine, "Die");primaryAttack = new PlayerPrimaryAttackState(this, stateMachine, "Attack");counterAttack = new PlayerCounterAttackState(this, stateMachine, "CounterAttack");aimSword = new PlayerAimSwordState(this,stateMachine, "AimSword");catchSword = new PlayerCatchSwordState(this, stateMachine, "CatchSword");blackhole = new PlayerBlackholeState(this, stateMachine, "Jump");//this 就是 Player这个类本身}//Awake初始化所以State,为所有State传入各自独有的参数,及animBool,以判断是否调用此动画(与animatoin配合完成)protected override void Start(){base.Start();stateMachine.Initialize(idleState);skill = SkillManager.instance;}protected override void Update()//在mano中update会自动刷新但其他没有mano的不会故,需要在这个updata中调用其他脚本中的函数stateMachine.currentState.update以实现 //stateMachine中的update{base.Update();stateMachine.currentState.Update();//反复调用CurrentState的Update函数CheckForDashInput();if(Input.GetKeyDown(KeyCode.F)){skill.crystal.CanUseSkill();}}public void AssignNewSword(GameObject _newSword)//保持创造的sword实例的函数{sword = _newSword;}public void CatchTheSword()//通过player的CatchTheSword进入,及当剑消失的瞬间进入{stateMachine.ChangeState(catchSword);Destroy(sword);}public IEnumerator BusyFor(float _seconds)//https://www.zhihu.com/tardis/bd/art/504607545?source_id=1001{isBusy = true;yield return new WaitForSeconds(_seconds);isBusy = false;}//p39 4.防止在攻击间隔中进入move,通过设置busy值,在使用某些状态时,使其为busy为true,抑制其进入其他state//IEnumertor本质就是将一个函数分块执行,只有满足某些条件才能执行下一段代码,此函数有StartCoroutine调用public void AnimationTrigger() => stateMachine.currentState.AnimationFinishTrigger();//从当前状态拿到AnimationTrigger进行调用的函数public void CheckForDashInput(){if (IsWallDetected()){return;}//修复在wallslide可以dash的BUGif (Input.GetKeyDown(KeyCode.LeftShift) && skill.dash.CanUseSkill())//将DashTimer<0 的判断 改成DashSkill里的判断{dashDir = Input.GetAxisRaw("Horizontal");//设置一个值,可以将dash的方向改为你想要的方向而不是你的朝向if (dashDir == 0){dashDir = facingDir;//只有当玩家没有控制方向时才使用默认朝向}stateMachine.ChangeState(dashState);}}//将Dash切换设置成一个函数,使其在所以情况下都能使用public override void Die(){base.Die();stateMachine.ChangeState(deadState);}
}
PlayerDeadState.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;public class PlayerDeadState : PlayerState
{public PlayerDeadState(Player _player, PlayerStateMachine _stateMachine, string _animBoolName) : base(_player, _stateMachine, _animBoolName){}public override void AnimationFinishTrigger(){base.AnimationFinishTrigger();}public override void Enter(){base.Enter();}public override void Exit(){base.Exit();}public override void Update(){base.Update();player.SetZeroVelocity();}
}

Enemy.cs
using System.Collections;
using System.Collections.Generic;
using Unity.VisualScripting;
using UnityEngine;public class Enemy : Entity
{[SerializeField] protected LayerMask whatIsPlayer;[Header("Stun Info")]public float stunnedDuration;//stunned持续时间public Vector2 stunnedDirection;//stunned改变后的速度protected bool canBeStunned;//判断是否可以被反击[SerializeField] protected GameObject counterImage;//一个代表着是否可以被反击的信号[Header("Move Info")]public float moveSpeed;public float idleTime;public float battleTime;//多久能从battle状态中退出来private float defaultMoveSpeed;[Header("Attack Info")]public float attackDistance;public float attackCooldown;//攻击冷却[HideInInspector] public float lastTimeAttacked;//最后一次攻击的时间#region 类public EnemyStateMachine stateMachine { get; private set; }public string lastingAnimBoolName{ get; private set; }public virtual void AssignLastAnimName(string _animBoolName){lastingAnimBoolName = _animBoolName;}#endregionprotected override void Awake(){base.Awake();stateMachine = new EnemyStateMachine();defaultMoveSpeed = moveSpeed;}protected override void Start(){base.Start();}protected override void Update(){base.Update();stateMachine.currentState.Update();//Debug.Log(IsPlayerDetected().collider.gameObject.name + "I see");//这串代码会报错,可能使版本的物体,因为在没有找到Player的时候物体是空的,NULL,你想让他在控制台上显示就报错了}public virtual void FreezeTime(bool _timeFrozen){if(_timeFrozen){moveSpeed = 0;anim.speed = 0;}else{moveSpeed = defaultMoveSpeed;anim.speed = 1;}}protected virtual IEnumerator FreezeTimeFor(float _seconds){FreezeTime(true);yield return new WaitForSeconds(_seconds);FreezeTime(false);}#region Counter Attack Windowpublic virtual void OpenCounterAttackWindow()//打开可以反击的信号的函数{canBeStunned = true;counterImage.SetActive(true);}public virtual void CloseCounterAttackWindow()//关闭可以反击的信号的函数{canBeStunned = false;counterImage.SetActive(false);}#endregionpublic virtual bool CanBeStunned()//这里的主要目的是完成在被反击过后能立刻关闭提示窗口{if (canBeStunned){CloseCounterAttackWindow();return true;}return false;}public virtual void AnimationFinishTrigger() => stateMachine.currentState.AnimationFinishTrigger();//动画完成时调用的函数,与Player相同public virtual RaycastHit2D IsPlayerDetected() => Physics2D.Raycast(wallCheck.position, Vector2.right * facingDir, 7, whatIsPlayer);//用于从射线投射获取信息的结构。//该函数的返回值可以变,可以只返回bool,也可以是碰到的结构protected override void OnDrawGizmos(){base.OnDrawGizmos();Gizmos.color = Color.yellow;//把线改成黄色Gizmos.DrawLine(transform.position, new Vector3(transform.position.x + attackDistance * facingDir, transform.position.y));//用来判别是否进入attackState的线}}

Enemy_Skeleton.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;public class EnemyState
{protected Enemy enemyBase;protected EnemyStateMachine stateMachine;protected Rigidbody2D rb;//小简化protected bool triggerCalled;private string animBoolName;protected float stateTimer;public EnemyState(Enemy _enemyBase, EnemyStateMachine _stateMachine, string _animBoolName){this.enemyBase = _enemyBase;this.stateMachine = _stateMachine;this.animBoolName = _animBoolName;}public virtual void Enter(){triggerCalled = false;enemyBase.anim.SetBool(animBoolName, true);rb = enemyBase.rb;//小简化}public virtual void Update(){stateTimer -= Time.deltaTime;}public virtual void Exit(){enemyBase.anim.SetBool(animBoolName, false);enemyBase.AssignLastAnimName(animBoolName);}//动画完成时调用的函数,与Player相同public virtual void AnimationFinishTrigger(){triggerCalled = true;}
}

EnemyState.cs
using System.Collections;
using System.Collections.Generic;
using Unity.VisualScripting;
using UnityEditorInternal;
using UnityEngine;public class Enemy_Skeleton : Enemy
{#region 类Statepublic SkeletonIdleState idleState { get; private set; }public SkeletonMoveState moveState { get; private set; }public SkeletonBattleState battleState { get; private set; }public SkeletonAttackState attackState { get; private set; }public SkeletonStunnedState stunnedState { get; private set; }public SkeletonDeadState deadState { get; private set; }#endregionprotected override void Awake(){base.Awake();idleState = new SkeletonIdleState(this, stateMachine, "Idle", this);moveState = new SkeletonMoveState(this,stateMachine, "Move", this);battleState = new SkeletonBattleState(this, stateMachine, "Move", this);attackState = new SkeletonAttackState(this, stateMachine, "Attack", this);stunnedState = new SkeletonStunnedState(this, stateMachine, "Stunned", this);deadState = new SkeletonDeadState(this, stateMachine, "Idle", this);}protected override void Start(){base.Start();stateMachine.Initialize(idleState);}protected override void Update(){base.Update();}public override bool CanBeStunned(){if (base.CanBeStunned())//在这里重写主要是因为只有在Skeleton里面才能调用stunnedState{stateMachine.ChangeState(stunnedState);return true;}return false;}//重写后不仅能达成在完成被反击后关闭提示窗口,还能转换为stunnedStatepublic override void Die(){base.Die();stateMachine.ChangeState(deadState);}
}
SkeletonDeadState.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;public class SkeletonDeadState : EnemyState
{private Enemy_Skeleton enemy;public SkeletonDeadState(Enemy _enemyBase, EnemyStateMachine _stateMachine, string _animBoolName,Enemy_Skeleton _enemy) : base(_enemyBase, _stateMachine, _animBoolName){this.enemy = _enemy;}public override void Enter(){base.Enter();enemy.anim.SetBool(enemy.lastingAnimBoolName, true);enemy.anim.speed = 0;enemy.cd.enabled = false;stateTimer = .1f;}public override void Update(){base.Update();if (stateTimer > 0)rb.velocity = new Vector2(0, 10);}
}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/748660.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

Spark-Transformation以及Action开发实战

文章目录 创建RDDTransformation以及ActionTransformation开发Action开发RDD持久化共享变量创建RDD RDD是Spark的编程核心,在进行Spark编程是,首要任务就是创建一个初始的RDDSpark提供三种创建RDD方式:集合、本地文件、HDFS文件 集合:主要用于本地测试,在实际部署到集群运…

51-31 VastGaussian,3D高斯大型场景重建

2024 年 2 月&#xff0c;清华大学、华为和中科院联合发布的 VastGaussian 模型&#xff0c;实现了基于 3D Gaussian Splatting 进行大型场景高保真重建和实时渲染。 Abstract 现有基于NeRF大型场景重建方法&#xff0c;往往在视觉质量和渲染速度方面存在局限性。虽然最近 3D…

C++第五弹---类与对象(二)

✨个人主页&#xff1a; 熬夜学编程的小林 &#x1f497;系列专栏&#xff1a; 【C语言详解】 【数据结构详解】【C详解】 类与对象 1、类对象模型 1.1、如何计算类对象的大小 1.2、类对象的存储方式猜测 1.3、结构体内存对齐规则 2、this指针 2.1、this指针的引出 2.2…

Cesium 获取 3dtileset的包围盒各顶点坐标

Cesium 获取 3dtileset的包围盒各顶点坐标 /*** 获取 3dtileset的包围盒各顶点坐标, z 方向取高度最低的位置* param {*} tileset* param {*} options* returns* ref https://blog.csdn.net/STANDBYF/article/details/135012273* ref https://community.cesium.com/t/accurate-…

双指针算法_移动零_

题目&#xff1a; 给定一个数组 num &#xff0c;编写一个函数将数组内部的数字0都移动到数组的末尾&#xff0c;同时保持非零元素的相对顺序&#xff01; 同时不能通过复制数组&#xff0c;开辟新的数组空间的情况下原地对数组进行操作 示例&#xff1a; 本题的原理&#x…

【New Release】PostgreSQL小版本(16.2, 15.6, 14.11, 13.14,12.18) 发布了

前言 PostgreSQL遵循小版本的发布规律&#xff0c;这一个季度的小版本又发布了。可以算作是2024年第一个季度的版本发布。如果总结其规律&#xff1a;大概就是2月、5月、8月、11月的样子。通常因为11月配合大版本的发布&#xff0c;它是起点&#xff0c;也有可能就是终点。起点…

Docker 中 Nginx 反向代理

本文主角&#xff1a;Nginx Proxy Manager 。 使用docker安装Nginx Proxy Manager。 1、找到C:\Windows\System32\drivers\etc下的hosts文件&#xff0c;添加 “域名 IP"即可。 使用vscode编辑文件&#xff0c;保存时会提示用管理员权限保存即可。 2、Nginx Proxy Mana…

力扣大厂热门面试算法题 36-38

36. 有效的数独&#xff0c;37. 解数独&#xff0c;38. 外观数列&#xff0c;每题做详细思路梳理&#xff0c;配套Python&Java双语代码&#xff0c; 2024.03.16 可通过leetcode所有测试用例。 目录 36. 有效的数独 解题思路 完整代码 Java Python 37. 解数独 解题思…

leetcode 判断是否为平衡二叉树

这个记得第一次写还是大二用c语言&#xff0c;当时非递归写了好久也没写完&#xff0c;用python递归思路简单&#xff0c;就是难想了一点&#xff0c;人生苦短&#xff0c;我用python哈哈哈.... 输入一棵二叉树的根节点&#xff0c;判断该树是不是平衡二叉树。如果某二叉树中任…

nmcli --help(nmcli -h)nmcli文档、nmcli手册

文章目录 nmcli --helpOPTION解释OBJECT解释1. g[eneral]&#xff1a;查看NetworkManager的状态2. n[etworking]&#xff1a;启用或禁用网络3. r[adio]&#xff1a;查看无线电状态&#xff08;例如&#xff0c;Wi-Fi&#xff09;4. c[onnection]&#xff1a;列出所有的网络连接…

【上海大学计算机组成原理实验报告】一、数据传送实验

一、实验目的 了解实验仪器数据总线的控制方式。掌握数据传送的基本原理。掌握各寄存器的结构、工作原理及其控制方法。 二、实验原理 根据实验指导书的相关内容&#xff0c;数据输入到寄存器的过程是先通过指令选择源和目标&#xff0c;再通过数据总线来传送数据&#xff0…

Python强大的库和框架——Pandas

NumPy 和 Pandas 是 Python 中用于科学计算和数据分析的两个重要库。 Pandas: 1. 概述&#xff1a; Pandas 是用于数据处理和分析的库&#xff0c;建立在 NumPy 的基础上&#xff0c;提供了高级的数据结构和数据操作工具。Pandas 的两个主要数据结构是 Series 和 DataFrame。…

Midjourney绘图欣赏系列(九)

Midjourney介绍 Midjourney 是生成式人工智能的一个很好的例子&#xff0c;它根据文本提示创建图像。它与 Dall-E 和 Stable Diffusion 一起成为最流行的 AI 艺术创作工具之一。与竞争对手不同&#xff0c;Midjourney 是自筹资金且闭源的&#xff0c;因此确切了解其幕后内容尚不…

IOS面试题object-c 101-110

101. typeof 和 __typeof,typeof 的区别?__typeof __() 和 __typeof() 是 C语言 的编译器特定扩展,因为标准 C 不包含这样的运算符。 标准 C 要求编译器用双下划线前缀语言扩展(这也是为什么你不应该为自己的函数,变量等做这些) typeof() 与前两者完全相同的,只不过去掉…

C/C++ 知识点:| 与 || 的区别

文章目录 一、|与 || 的区别1、按位或运算符 |2、逻辑或运算符 ||3、区别4、总结 前言 在C编程语言中&#xff0c;逻辑或运算符用于连接两个条件表达式&#xff0c;当至少有一个条件为真时&#xff0c;整个表达式的结果为真。C提供了两种逻辑或运算符&#xff1a;按位或|和逻辑…

VS Code上,QT基于cmake,qmake的构建方法(非常详细)

VS Code上,QT基于cmake&#xff0c;qmake的构建方法 1 前言2 QT基于cmake的构建方法2.1 VS Code关键插件安装2.2 系统环境变量配置2.3 VS Code中&#xff0c;环境变量配置2.4 Cmake新建一个新的Porject 3 QT基于qmake的构建方法 1 前言 最近&#xff0c;由于认证了github的学生…

每日一篇 3.16

on course to 有望 no sign of 没有迹象 its economy continues to hum hum:蓬勃发展 unprecedented international sanctions unprecedented&#xff1a;前所未有的 sanction:制裁 change the constitution&#xff1a;改变宪法 overhauling the law&#xff1a;彻底修…

代码贴--动态顺序表--数据结构

本博客将记录操作系统中的动态顺序表的相关代码 头文件&#xff08;SeList.h&#xff09; #pragma once #include<stdio.h> #include<string.h> #include<stdlib.h> #include<assert.h> typedef int SQDataType; //动态顺序表typedef struct SeqList…

2024年Vue3 面试题小总结

Vue3 面试题小总结 1. OptionsAPI 与 CompositionAPI 的区别&#xff1f; OptionsAPI&#xff1a; 选项式API&#xff0c;通过定义data、computed、watch、method等属性与方法&#xff0c;共同处理页面逻辑&#xff1b;缺点&#xff1a; 当组件变得复杂的时候&#xff0c;导致…

《工厂模式(极简c++)》

本文章属于专栏《设计模式&#xff08;极简c版&#xff09;》 继续上一篇《设计原则》。本章简要说明工厂模式。本文分为模式说明、本质思想、实践建议、代码示例四个部分。 模式说明&#xff1a; 简单工厂模式 方案&#xff1a;对象不直接new&#xff0c;而是通过另一个类&am…