【unity实战】使用旧输入系统Input Manager 写一个 2D 平台游戏玩家控制器——包括移动、跳跃、滑墙、蹬墙跳

news/2024/10/5 22:36:28/

最终效果

在这里插入图片描述

文章目录

  • 最终效果
  • 素材下载
    • 人物
    • 环境
  • 简单绘制环境
  • 角色移动跳跃
  • 视差和摄像机跟随效果
  • 奔跑动画切换
  • 跳跃动画,跳跃次数限制
  • 角色添加2d物理材质,防止角色粘在墙上
  • 如果角色移动时背景出现黑线条
    • 方法一
    • 方法二
  • 墙壁滑行
  • 实现角色滑墙不可以通过移动离开且不可翻转角色
  • 空中运动控制
  • 可变跳跃高度
  • 蹬墙跳
  • 完整代码
  • 源码
  • 完结

素材下载

人物

https://rvros.itch.io/animated-pixel-hero
在这里插入图片描述

环境

https://bardent.itch.io/the-bardent-asset-pack
在这里插入图片描述
https://brullov.itch.io/oak-woods
在这里插入图片描述

简单绘制环境

参考:【推荐100个unity插件之14】Unity2D TileMap的探究(最简单,最全面的TileMap使用介绍)
在这里插入图片描述

角色移动跳跃

新增PlayerController

public class PlayerController : MonoBehaviour
{private float movementInputDirection; // 水平输入方向private bool isFacingRight = true; // 玩家是否面向右侧private Rigidbody2D rb;public float movementSpeed = 10.0f; // 移动速度public float jumpForce = 16.0f; // 跳跃力度void Start(){rb = GetComponent<Rigidbody2D>();}void Update(){CheckInput(); // 检查输入CheckMovementDirection();}private void FixedUpdate(){ApplyMovement(); // 应用移动}// 检查玩家面朝的方向private void CheckMovementDirection(){if (isFacingRight && movementInputDirection < 0){Flip(); // 翻转角色}else if (!isFacingRight && movementInputDirection > 0){Flip(); // 翻转角色}}// 检查输入private void CheckInput(){movementInputDirection = Input.GetAxisRaw("Horizontal"); // 获取水平输入if (Input.GetButtonDown("Jump")){Jump(); // 如果按下跳跃键,则执行跳跃}}// 跳跃private void Jump(){rb.velocity = new Vector2(rb.velocity.x, jumpForce); // 设置 y 方向的速度为跳跃力度}// 移动private void ApplyMovement(){rb.velocity = new Vector2(movementSpeed * movementInputDirection, rb.velocity.y); // 设置 x 方向的速度}// 翻转角色private void Flip(){isFacingRight = !isFacingRight; // 改变面向方向的标志transform.Rotate(0.0f, 180.0f, 0.0f); // 旋转角色}
}

配置
在这里插入图片描述
效果
在这里插入图片描述

视差和摄像机跟随效果

参考:【unity小技巧】Unity实现视差效果与无限地图

新增CameraController代码

public class CameraController : MonoBehaviour
{public Transform target;//玩家的位置public Transform farBackground, middleBackground, frontBackground;//远的背景和中间背景的位置private Vector2 lastPos;//最后一次的相机位置void Start(){lastPos = transform.position;//记录相机的初始位置}void Update(){//将相机的位置设置为玩家的位置,但限制在一定的垂直范围内//transform.position = new Vector3(target.position.x, target.position.y + 1f, transform.position.z);//计算相机在上一帧和当前帧之间移动的距离Vector2 amountToMove = new Vector2(transform.position.x - lastPos.x, transform.position.y - lastPos.y);//根据相机移动的距离,移动远背景和中间背景的位置farBackground.position += new Vector3(amountToMove.x, amountToMove.y, 0f);middleBackground.position += new Vector3(amountToMove.x * 0.9f, amountToMove.y, 0f);frontBackground.position += new Vector3(amountToMove.x * 0.5f, amountToMove.y, 0f);lastPos = transform.position;//更新最后一次的相机位置}
}

Map代码

public class Map : MonoBehaviour
{[Header("无限地图")]private GameObject mainCamera;//主摄像机对象private float mapwidth;//地图宽度private float totalwidth;//总地图宽度public int mapNums;//地图重复的次数void Start(){mainCamera = GameObject.FindGameObjectWithTag("MainCamera");//查找标签为"MainCamera'"的对象并赋值mapwidth = GetComponent<SpriteRenderer>().sprite.bounds.size.x;//通过SpriteRenderer获得图像宽度totalwidth = mapwidth * mapNums;//计算总地图宽度}void FixedUpdate(){Vector3 tempPosition = transform.position;//获取当前位置if (mainCamera.transform.position.x > transform.position.x + totalwidth / 2){tempPosition.x += totalwidth;//将地图向右平移一个完整的地图宽度transform.position = tempPosition;//更新位置}else if (mainCamera.transform.position.x < transform.position.x - totalwidth / 2){tempPosition.x -= totalwidth;//将地图向左平移一个完整的地图宽度transform.position = tempPosition;//更新位置}}
}

配置
在这里插入图片描述
在这里插入图片描述
效果
在这里插入图片描述

奔跑动画切换

动画配置
在这里插入图片描述

修改PlayerController

private void FixedUpdate()
{ApplyMovement(); // 应用移动UpdateStatus();
}//判断状态 
private void UpdateStatus(){if(rb.velocity.x != 0){isRunning = true;}else{isRunning = false;}
}//播放动画
private void UpdateAnimations(){animator.SetBool("isRunning", isRunning);
}

效果
在这里插入图片描述

跳跃动画,跳跃次数限制

配置跳跃动画
在这里插入图片描述

在这里插入图片描述
在这里插入图片描述
修改PlayerController

[Header("跳跃 地面检测")]
private float amountOfJumpsLeft;//当前可跳跃次数
private bool isGround;//是否是地面
private bool canJump;//能否跳跃
public int amountOfJumps = 1;//跳跃次数
public float groundCheckRadius;//地面检测距离
public Transform groundCheck;//地面检测点
public LayerMask whatIsGround;//地面检测图层void Start()
{rb = GetComponent<Rigidbody2D>();animator = GetComponent<Animator>();amountOfJumpsLeft = amountOfJumps;
}// 检查输入
private void CheckInput()
{movementInputDirection = Input.GetAxisRaw("Horizontal"); // 获取水平输入if (Input.GetButtonDown("Jump")){Jump(); // 如果按下跳跃键,则执行跳跃}
}// 跳跃
private void Jump()
{if (canJump){rb.velocity = new Vector2(rb.velocity.x, jumpForce); // 设置 y 方向的速度为跳跃力度amountOfJumpsLeft--;}
}//判断能否跳跃
private void CheckIfCanJump()
{if (isGround && rb.velocity.y < 0){amountOfJumpsLeft = amountOfJumps;}if (amountOfJumpsLeft <= 0){canJump = false;}else{canJump = true;}
}//播放动画
private void UpdateAnimations()
{animator.SetBool("isRunning", isRunning);animator.SetBool("isGround", isGround);animator.SetFloat("yVelocity", rb.velocity.y);
}//检测
private void CheckSurroundings()
{//地面检测isGround = Physics2D.OverlapCircle(groundCheck.position, groundCheckRadius, whatIsGround);
}//视图显示检测范围
private void OnDrawGizmos()
{Gizmos.DrawWireSphere(groundCheck.position, groundCheckRadius);
}

配置,这里配置了2段跳
在这里插入图片描述
记得配置地面图层为Ground
在这里插入图片描述
效果
在这里插入图片描述

角色添加2d物理材质,防止角色粘在墙上

在这里插入图片描述
修改摩檫力为0
在这里插入图片描述
配置
在这里插入图片描述
效果
在这里插入图片描述

如果角色移动时背景出现黑线条

方法一

添加材质
在这里插入图片描述
配置
在这里插入图片描述

方法二

我们创建了一个Sprite Atlas来将Spritesheet拖入其中
在这里插入图片描述
把你的瓦片素材拖入
在这里插入图片描述

墙壁滑行

配置滑墙动画
在这里插入图片描述

修改PlayerController

[Header("墙壁滑行")]
public float wallCheckDistance;//墙壁检测距离
public Transform wallCheck;//墙壁检测点
public float wallSlideSpeed;//墙壁滑行速度
private bool isTouchingWall;//是否接触墙壁
private bool isWallSliding;//是否正在墙壁滑行// 移动
private void ApplyMovement()
{rb.velocity = new Vector2(movementSpeed * movementInputDirection, rb.velocity.y); // 设置 x 方向的速度//应用滑墙速度    if (isWallSliding){if (rb.velocity.y < -wallSlideSpeed){rb.velocity = new Vector2(rb.velocity.x, -wallSlideSpeed);// 限制垂直速度以应用墙壁滑行速度}}
}//是否正在墙壁滑行
private void CheckIfWallSliding()
{if (isTouchingWall && !isGround && rb.velocity.y < 0){isWallSliding = true;}else{isWallSliding = false;}
}//播放动画
private void UpdateAnimations()
{animator.SetBool("isRunning", isRunning);animator.SetBool("isGround", isGround);animator.SetFloat("yVelocity", rb.velocity.y);animator.SetBool("isWallSliding", isWallSliding);
}//检测
private void CheckSurroundings()
{//地面检测isGround = Physics2D.OverlapCircle(groundCheck.position, groundCheckRadius, whatIsGround);//墙面检测isTouchingWall = Physics2D.Raycast(wallCheck.position, transform.right, wallCheckDistance, whatIsGround);
}//视图显示检测范围
private void OnDrawGizmos()
{Gizmos.DrawWireSphere(groundCheck.position, groundCheckRadius);Gizmos.DrawLine(wallCheck.position, wallCheck.position + wallCheckDistance * Vector3.right);
}

配置
在这里插入图片描述
效果
在这里插入图片描述

实现角色滑墙不可以通过移动离开且不可翻转角色

// 移动
private void ApplyMovement()
{// 如果在地面上if (isGround){rb.velocity = new Vector2(movementSpeed * movementInputDirection, rb.velocity.y); // 设置 x 方向的速度}//应用滑墙速度    if (isWallSliding){if (rb.velocity.y < -wallSlideSpeed){rb.velocity = new Vector2(rb.velocity.x, -wallSlideSpeed);// 限制垂直速度以应用墙壁滑行速度}}
}// 翻转角色
private void Flip()
{if (!isWallSliding){isFacingRight = !isFacingRight; // 改变面向方向的标志transform.Rotate(0.0f, 180.0f, 0.0f); // 旋转角色}
}

效果
在这里插入图片描述

空中运动控制

空气阻力和移动速度控制

public float movementForceInAir;//空气中的运动力
public float airDragMultiplier = 0.95f;//空气阻力// 移动
private void ApplyMovement()
{// 如果在地面上if (isGround){rb.velocity = new Vector2(movementSpeed * movementInputDirection, rb.velocity.y); // 设置 x 方向的速度}// 如果不在地面上且不是在墙壁滑行且有水平输入else if (!isGround && !isWallSliding && movementInputDirection != 0){Vector2 forceToAdd = new Vector2(movementForceInAir * movementInputDirection, 0);// 在空中施加的力rb.AddForce(forceToAdd);// 添加力到刚体if (Mathf.Abs(rb.velocity.x) > movementSpeed){rb.velocity = new Vector2(movementSpeed * movementInputDirection, rb.velocity.y);// 限制水平速度}}// 如果不在地面上且不是在墙壁滑行且没有水平输入else if (!isGround && !isWallSliding && movementInputDirection == 0){rb.velocity = new Vector2(rb.velocity.x * airDragMultiplier, rb.velocity.y);// 应用空气阻力}//应用滑墙速度    if (isWallSliding){if (rb.velocity.y < -wallSlideSpeed){rb.velocity = new Vector2(rb.velocity.x, -wallSlideSpeed);// 限制垂直速度以应用墙壁滑行速度}}
}

配置
在这里插入图片描述
效果
在这里插入图片描述

可变跳跃高度

长跳跃和短跳,长按和之前跳的和之前一样高

public float variableJumpHeightMultiplier = 0.5f;// 检查输入
private void CheckInput()
{movementInputDirection = Input.GetAxisRaw("Horizontal"); // 获取水平输入if (Input.GetButtonDown("Jump")){Jump(); // 如果按下跳跃键,则执行跳跃}// 检测是否松开Jumpif (Input.GetButtonUp("Jump")){rb.velocity = new Vector2(rb.velocity.x, rb.velocity.y * variableJumpHeightMultiplier);}
}

效果
在这里插入图片描述

蹬墙跳

实现不输入,点击跳跃就从墙上跳下来,方向按键+跳跃控制左右蹬墙跳

[Header("蹬墙跳")]
public float wallHopForce; // 离开墙时的力
public float wallJumpForce; // 蹬墙跳时施加的力
public Vector2 wallHopDirection; // 离开墙时的方向向量
public Vector2 wallJumpDirection; // 蹬墙跳时的方向向量
private int facingDirection = 1; // 角色面向的方向,1右 -1左void Start()
{rb = GetComponent<Rigidbody2D>();animator = GetComponent<Animator>();amountOfJumpsLeft = amountOfJumps;//归一化向量,因为我们只要向量的方向,而不考虑长度wallHopDirection = wallHopDirection.normalized;wallJumpDirection = wallJumpDirection.normalized;
}// 跳跃
private void Jump()
{// 如果可以跳跃并且不是在墙壁滑行状态下if (canJump && !isWallSliding){rb.velocity = new Vector2(rb.velocity.x, jumpForce); // 设置 y 方向的速度为跳跃力度amountOfJumpsLeft--;}// 如果正在墙壁滑行且没有输入水平移动方向,并且可以跳跃else if(isWallSliding && movementInputDirection == 0 && canJump){isWallSliding = false;amountOfJumpsLeft--;// 计算添加的力量,使角色从墙壁上弹开Vector2 forceToAdd = new Vector2(wallHopForce * wallHopDirection.x * -facingDirection, wallHopForce * wallHopDirection.y);rb.AddForce(forceToAdd, ForceMode2D.Impulse);}// 如果正在墙壁滑行或者正在接触墙壁,并且有水平移动输入,并且可以跳跃else if((isWallSliding || isTouchingWall) && movementInputDirection != 0 && canJump){isWallSliding = false;amountOfJumpsLeft --;// 计算添加的力量,使角色从墙壁上跳跃Vector2 forceToAdd = new Vector2(wallHopForce * wallHopDirection.x * movementInputDirection, wallJumpForce * wallJumpDirection.y);rb.AddForce(forceToAdd, ForceMode2D.Impulse);}
}//判断能否跳跃
private void CheckIfCanJump()
{if ((isGround && rb.velocity.y < 0) || isWallSliding){amountOfJumpsLeft = amountOfJumps;}if (amountOfJumpsLeft <= 0){canJump = false;}else{canJump = true;}
}// 翻转角色
private void Flip()
{if (!isWallSliding){facingDirection *= -1;isFacingRight = !isFacingRight; // 改变面向方向的标志transform.Rotate(0.0f, 180.0f, 0.0f); // 旋转角色}
}

配置
在这里插入图片描述
运行效果
在这里插入图片描述

完整代码

using Unity.VisualScripting;
using UnityEngine;public class PlayerController : MonoBehaviour
{private float movementInputDirection; // 水平输入方向private bool isFacingRight = true; // 玩家是否面向右侧private Rigidbody2D rb;public float movementSpeed = 10.0f; // 移动速度public float jumpForce = 16.0f; // 跳跃力度private Animator animator;[Header("状态")]public bool isRunning;[Header("跳跃 地面检测")]public int amountOfJumps = 1;//跳跃次数public float groundCheckRadius;//地面检测距离public Transform groundCheck;//地面检测点public LayerMask whatIsGround;//地面检测图层private float amountOfJumpsLeft;//当前可跳跃次数private bool isGround;//是否是地面private bool canJump;//能否跳跃[Header("墙壁滑行")]public float wallCheckDistance;//墙壁检测距离public Transform wallCheck;//墙壁检测点public float wallSlideSpeed;//墙壁滑行速度public float movementForceInAir;//空气中的运动力public float airDragMultiplier = 0.95f;//空气阻力private bool isTouchingWall;//是否接触墙壁private bool isWallSliding;//是否正在墙壁滑行[Header("可变高度")]public float variableJumpHeightMultiplier = 0.5f;[Header("蹬墙跳")]public float wallHopForce; // 离开墙时的力public float wallJumpForce; // 蹬墙跳时施加的力public Vector2 wallHopDirection; // 离开墙时的方向向量public Vector2 wallJumpDirection; // 蹬墙跳时的方向向量private int facingDirection = 1; // 角色面向的方向,1右 -1左void Start(){rb = GetComponent<Rigidbody2D>();animator = GetComponent<Animator>();amountOfJumpsLeft = amountOfJumps;//归一化向量,因为我们只要向量的方向,而不考虑长度wallHopDirection = wallHopDirection.normalized;wallJumpDirection = wallJumpDirection.normalized;}void Update(){CheckInput(); // 检查输入CheckMovementDirection();UpdateAnimations();CheckIfCanJump();CheckIfWallSliding();CheckSurroundings();}private void FixedUpdate(){ApplyMovement(); // 应用移动UpdateStatus();}// 检查玩家面朝的方向private void CheckMovementDirection(){if (isFacingRight && movementInputDirection < 0){Flip(); // 翻转角色}else if (!isFacingRight && movementInputDirection > 0){Flip(); // 翻转角色}}// 检查输入private void CheckInput(){movementInputDirection = Input.GetAxisRaw("Horizontal"); // 获取水平输入if (Input.GetButtonDown("Jump")){Jump(); // 如果按下跳跃键,则执行跳跃}if (Input.GetButtonUp("Jump")){rb.velocity = new Vector2(rb.velocity.x, rb.velocity.y * variableJumpHeightMultiplier);}}// 移动private void ApplyMovement(){// 如果在地面上if (isGround){rb.velocity = new Vector2(movementSpeed * movementInputDirection, rb.velocity.y); // 设置 x 方向的速度}// 如果不在地面上且不是在墙壁滑行且有水平输入else if (!isGround && !isWallSliding && movementInputDirection != 0){Vector2 forceToAdd = new Vector2(movementForceInAir * movementInputDirection, 0);// 在空中施加的力rb.AddForce(forceToAdd);// 添加力到刚体if (Mathf.Abs(rb.velocity.x) > movementSpeed){rb.velocity = new Vector2(movementSpeed * movementInputDirection, rb.velocity.y);// 限制水平速度}}// 如果不在地面上且不是在墙壁滑行且没有水平输入else if (!isGround && !isWallSliding && movementInputDirection == 0){rb.velocity = new Vector2(rb.velocity.x * airDragMultiplier, rb.velocity.y);// 应用空气阻力}// //应用滑墙速度    if (isWallSliding){if (rb.velocity.y < -wallSlideSpeed){rb.velocity = new Vector2(rb.velocity.x, -wallSlideSpeed);// 限制垂直速度以应用墙壁滑行速度}}}// 移动private void ApplyMovement(){if(!isGround && !isWallSliding && movementInputDirection == 0){rb.velocity = new Vector2(rb.velocity.x * airDragMultiplier, rb.velocity.y);// 应用空气阻力}else{rb.velocity = new Vector2(movementSpeed * movementInputDirection, rb.velocity.y); // 设置 x 方向的速度}//应用滑墙速度    if (isWallSliding){if (rb.velocity.y < -wallSlideSpeed){rb.velocity = new Vector2(rb.velocity.x, -wallSlideSpeed);// 限制垂直速度以应用墙壁滑行速度}}}//判断跑步状态 private void UpdateStatus(){if(rb.velocity.x != 0){isRunning = true;}else{isRunning = false;}}// 翻转角色private void Flip(){if (!isWallSliding){facingDirection *= -1;isFacingRight = !isFacingRight; // 改变面向方向的标志transform.Rotate(0.0f, 180.0f, 0.0f); // 旋转角色}}//播放动画private void UpdateAnimations(){animator.SetBool("isRunning", isRunning);animator.SetBool("isGround", isGround);animator.SetFloat("yVelocity", rb.velocity.y);animator.SetBool("isWallSliding", isWallSliding);}//判断能否跳跃private void CheckIfCanJump(){if ((isGround && rb.velocity.y < 0) || isWallSliding){amountOfJumpsLeft = amountOfJumps;}if (amountOfJumpsLeft <= 0){canJump = false;}else{canJump = true;}}//检测private void CheckSurroundings(){//地面检测isGround = Physics2D.OverlapCircle(groundCheck.position, groundCheckRadius, whatIsGround);//墙面检测isTouchingWall = Physics2D.Raycast(wallCheck.position, transform.right, wallCheckDistance, whatIsGround);}//是否墙壁滑行private void CheckIfWallSliding(){if (isTouchingWall && !isGround && rb.velocity.y < 0){isWallSliding = true;}else{isWallSliding = false;}}//视图显示检测范围private void OnDrawGizmos(){Gizmos.DrawWireSphere(groundCheck.position, groundCheckRadius);Gizmos.DrawLine(wallCheck.position, wallCheck.position + wallCheckDistance * Vector3.right);}
}

源码

整理好了我会放上来

完结

赠人玫瑰,手有余香!如果文章内容对你有所帮助,请不要吝啬你的点赞评论和关注,以便我第一时间收到反馈,你的每一次支持都是我不断创作的最大动力。当然如果你发现了文章中存在错误或者有更好的解决方法,也欢迎评论私信告诉我哦!

好了,我是向宇,https://xiangyu.blog.csdn.net

一位在小公司默默奋斗的开发者,出于兴趣爱好,最近开始自学unity,闲暇之余,边学习边记录分享,站在巨人的肩膀上,通过学习前辈们的经验总是会给我很多帮助和启发!php是工作,unity是生活!如果你遇到任何问题,也欢迎你评论私信找我, 虽然有些问题我也不一定会,但是我会查阅各方资料,争取给出最好的建议,希望可以帮助更多想学编程的人,共勉~
在这里插入图片描述


http://www.ppmy.cn/news/1473612.html

相关文章

路径规划 | 基于蜣螂优化算法的栅格地图机器人路径规划(Matlab)

目录 效果一览基本介绍程序设计参考文献 效果一览 基本介绍 路径规划 | 基于蜣螂优化算法的栅格地图机器人路径规划&#xff08;Matlab&#xff09; 1.利用蜣螂算法DBO优化栅格地图机器人路径规划&#xff0c;效果如图所示&#xff0c;包括迭代曲线图、栅格地图等等&#xff5e…

详细解释下flutter初始示例的代码

详细解释下flutter初始示例的代码 main 首句导入需要的包 类似于其他语言的import main函数为入口函数 包裹MyApp类 MyApp 这个类继承自无状态类 可见myapp不管理任何状态 build方法是所有widget内必须实现的方法 此处返回一个 ChangeNotferiProvider 可以看到它用于管理应…

LVS+Keepalived 实现高可用负载均衡

前言 在业务量达到一定量的时候&#xff0c;往往单机的服务是会出现瓶颈的。此时最常见的方式就是通过负载均衡来进行横向扩展。其中我们最常用的软件就是 Nginx。通过其反向代理的能力能够轻松实现负载均衡&#xff0c;当有服务出现异常&#xff0c;也能够自动剔除。但是负载…

谷粒商城学习-08-linux安装docker

文章目录 一&#xff0c;docker简介1&#xff0c;初识docker2&#xff0c;docker解决了什么痛点2.1 模板化部署&#xff0c;提升部署效率&#xff0c;提高部署可靠性2.2 节约资源 二&#xff0c;Docker Hub镜像仓库三&#xff0c;Docker1&#xff0c;卸载之前安装的docker2&…

anaconda中下载压缩包并用conda安装包

有时直接conda安装包时会出错&#xff1b;报错PackagesNotFoundError: The following packages are not available from current channels 比如 conda install -y bioconda::ucsc-gtftogenepred #直接安装报错 #直接下载压缩包安装https://blog.csdn.net/weixin_45552562/ar…

element-ui Tree之懒加载叶子节点强制设置父级半选效果

效果&#xff1a; 前言&#xff1a; 我们是先只展示一级的&#xff0c;二级的数据是通过点击之后通过服务器获取数据&#xff0c;并不是全量数据直接一起返回回来的。 问题&#xff1a; 当你设置了默认选中的子节点&#xff0c;但是由于刚进入页面此时tree中数据暂是没有这个…

【十三】图解 Spring 核心数据结构:BeanDefinition 其二

图解 Spring 核心数据结构&#xff1a;BeanDefinition 其二 概述 前面写过一篇相关文章作为开篇介绍了一下BeanDefinition&#xff0c;本篇将深入细节来向读者展示BeanDefinition的设计&#xff0c;让我们一起来揭开日常开发中使用的bean的神秘面纱&#xff0c;深入细节透彻理解…

Linux系统的基础知识和常用命令

1、什么是Linux&#xff1f; 是一种免费使用和自由传播的类UNIX操作系统&#xff0c;其内核由林纳斯本纳第克特托瓦兹于1991年10月5日首次发布&#xff0c;它主要受到Minix和Unix思想的启发&#xff0c;是一个基于POSIX的多用户、多任务、支持多线程和多CPU的操作系统。它能运行…