【用unity实现100个游戏之10】复刻经典俄罗斯方块游戏

文章目录

  • 前言
  • 开始项目
  • 网格生成
  • Block方块脚本
  • 俄罗斯方块基类,绘制方块形状
  • 移动逻辑
  • 限制移动
  • 自由下落
  • 下落后设置对应风格为不可移动类型
  • 检查当前方块是否可以向指定方向移动
  • 旋转逻辑
  • 消除逻辑
  • 游戏结束逻辑
  • 怪物生成
  • 源码
  • 参考
  • 完结

前言

当今游戏产业中,经典游戏的复刻一直是一项受欢迎且具有挑战性的任务。俄罗斯方块是一个深入人心、令人上瘾的经典游戏,在过去几十年里一直享有广泛的流行度。其简单而富有策略性的玩法吸引了无数玩家的关注。因此,我决定利用Unity引擎来复刻这款经典游戏,以让更多的人重新体验其中的乐趣。

通过使用Unity引擎,我能够利用其强大的工具和功能,从头开始构建一个与原版俄罗斯方块游戏相似的游戏。我将努力保持原版游戏的核心要素,包括七种不同形状的方块(俄罗斯方块),玩家可以通过旋转和移动这些方块来填充完整的水平行,完成消除并得分的目标。

除了保留原版玩法外,我还计划为游戏添加一些额外的功能和改进。例如,增加多样化的难度级别,使得游戏适合任何玩家的技能水平。我还计划添加特殊的道具或技能,使游戏更加丰富有趣。此外,我还将注重游戏的视觉效果和音效,以提升玩家的沉浸感。

我的目标是创造一个令人难以抗拒的游戏体验,让玩家们在回忆经典之余,也能感受到崭新的乐趣。无论是单人挑战高分,还是与朋友们一较高下,这个复刻版的俄罗斯方块游戏都将带给玩家们小时候的回忆和喜悦。

我非常兴奋能够应用Unity引擎来实现这个愿望,并期待将来能与大家分享这款复刻版俄罗斯方块游戏。在这个过程中,我将努力改进和完善游戏,以确保它可以在各种平台上流畅运行,并为玩家们带来最佳的游戏体验。

谢谢大家的支持和关注!让我们一起回味经典,畅享游戏的乐趣吧!

先来看看实现的最终效果
在这里插入图片描述

开始项目

链接:https://pan.baidu.com/s/1BMlwclVV2gOdnNppSc7v6A
提取码:hxfs

网格生成

泛型单例

using System.Collections;
using System.Collections.Generic;
using UnityEngine;public class SingleBase<T> : MonoBehaviour where T : class
{public static T Instance;protected virtual void Awake(){Instance = this as T;}
}

游戏管理类

using System.Collections;
using System.Collections.Generic;
using UnityEngine;public class GameManager : SingleBase<GameManager>
{protected override void Awake(){base.Awake();}private void Start(){OnStartGame();}//开始游戏void OnStartGame(){//网格生成MapManager.Instance.InitMap();}
}

简单工厂类

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
///<summary>
//简单工厂
///</summary>
public static class SimpleFactory
{//创建Resources/Model中的物体public static GameObject CreateModel(string name, Transform parent){return Object.Instantiate(Resources.Load("Model/" + name), parent) as GameObject;}
}

网格地图生成

//常量类
public static class Defines
{public static readonly int RowCount = 15;//网格行数public static readonly int ColCount = 10;//网格列数public static readonly float Offset = 0.9f;//格子间隔
}

网格地图管理器

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
//网格地图管理器
public class MapManager : SingleBase<MapManager>
{//初始化网格地图public void InitMap(){for (int row = 0; row < Defines.RowCount; row++){for (int col = 0; col < Defines.ColCount; col++){GameObject obj = SimpleFactory.CreateModel("block", transform);obj.transform.localPosition = new Vector3(col * Defines.Offset, -row * Defines.Offset, 0);}}}
}

挂载GameManager和MapManager
在这里插入图片描述
运行效果
在这里插入图片描述

Block方块脚本

新建Block 方块脚本

using System.Collections;
using System.Collections.Generic;
using UnityEngine;public enum BlockType
{Empty,//空Static,//不动Model,//模型
}//方块脚本
public class Block : MonoBehaviour
{public BlockType type;public int RowIndex;public int ColIndex;public SpriteRenderer sp;public Sprite normalSprite;//默认的图片public Sprite modelSprite;//怪物图片public void Init(int row, int col, BlockType type){this.type = type;this.RowIndex = row;this.ColIndex = col;}private void Awake(){sp = GetComponent<SpriteRenderer>();normalSprite = sp.sprite;modelSprite = Resources.Load<Sprite>("Icon/gbl");}private void Start(){SetTypeToSp();}public void SetTypeToSp(){switch (this.type){case BlockType.Empty:sp.sprite = normalSprite;sp.color = Color.white;break;case BlockType.Static:sp.color = Color.red;break;case BlockType.Model:sp.sprite = modelSprite;sp.color = Color.white;break;}}
}

网格地图管理器MapManager 调用

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
//网格地图管理器
public class MapManager : SingleBase<MapManager>
{public Block[,] blockArr;//初始化网格地图public void InitMap(){blockArr = new Block[Defines.RowCount,Defines.ColCount];for (int row = 0; row < Defines.RowCount; row++){for (int col = 0; col < Defines.ColCount; col++){GameObject obj = SimpleFactory.CreateModel("block", transform);obj.transform.localPosition = new Vector3(col * Defines.Offset, -row * Defines.Offset, 0);Block b = obj.AddComponent<Block>();b.Init(row, col, BlockType.Model);//存储到二维数组blockArr[row, col] = b;}}}
}

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

俄罗斯方块基类,绘制方块形状

MapManager新增方法

//切换对应下标的方块的类型
public void ChangeType(int row, int col, BlockType type)
{Block b = blockArr[row, col];b.type = type;b.SetTypeToSp();
}

俄罗斯方块基类

//俄罗斯方块基类
public class TetrisBase
{public int rowIndex;//对应整个网格的行坐标public int colIndex;//对应整个网格的列坐标public int rowCount;//存储形状的行总数public int colCount;//存储形状的列总数public BlockType[,] blockArr;//存储枚举的二维数组//初始化public virtual void Init(){}//画自己(更改网格对应的图片精灵)public virtual void DrawMe(){for (int row = 0; row < rowCount; row++){for (int col = 0; col < colCount; col++){if (blockArr[row, col] != BlockType.Empty){int map_rowIndex = rowIndex + row;int map_colIndex = colIndex + col;MapManager.Instance.ChangeType(map_rowIndex, map_colIndex, blockArr[row, col]);}}}}//擦除自己public virtual void WipeMe(){for (int row = 0; row < rowCount; row++){for (int col = 0; col < colCount; col++){if (blockArr[row, col] != BlockType.Empty){int map_rowIndex = rowIndex + row;int map_colIndex = colIndex + col;MapManager.Instance.ChangeType(map_rowIndex, map_colIndex, BlockType.Empty);}}}}//向下移动public virtual void MoveDown(){rowIndex++;}//左移动public virtual void MoveLeft(){colIndex--;}//右移动public virtual void MoveRight(){colIndex++;}
}

T形状的俄罗斯方块

//T形状的俄罗斯方块
public class Tetris_T : TetrisBase
{public override void Init(){rowCount = 2;colCount = 3;blockArr = new BlockType[,]{{BlockType.Model,BlockType.Model,BlockType.Model},{BlockType.Empty,BlockType.Model,BlockType.Empty}};}
}

GameManager调用,绘制方块形状

TetrisBase currentTetris;//当前操作的俄罗斯//开始游戏
void OnStartGame()
{//网格生成MapManager.Instance.InitMap();currentTetris = CreateTetris();//画出来currentTetris.DrawMe();
}//创建
TetrisBase CreateTetris()
{TetrisBase t = new Tetris_T();t.Init();t.colIndex = Defines.ColCount / 2 - t.colCount / 2;return t;
}

效果
在这里插入图片描述

移动逻辑

定义移动方向枚举

//移动方向
public enum Direction
{None,Right,Left,Down
}

修改俄罗斯方块基类TetrisBase

//根据方向移动
public virtual void MoveByDir(Direction dir)
{//擦除自己WipeMe();switch (dir){case Direction.None:break;case Direction.Right:MoveRight();break;case Direction.Left:MoveLeft();break;case Direction.Down:MoveDown();break;}DrawMe();//画自己
}

GameManager新增用户操作

void Update(){InputCtl();
}
//用户操作
public void InputCtl()
{if (Input.GetKeyDown(KeyCode.A))currentTetris.MoveByDir(Direction.Left);if (Input.GetKeyDown(KeyCode.D))currentTetris.MoveByDir(Direction.Right);if (Input.GetKeyDown(KeyCode.S))currentTetris.MoveByDir(Direction.Down);
}

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

限制移动

俄罗斯方块基类TetrisBase新增方法

//是否能移动的方向
public virtual bool IsCanMove(Direction dir)
{int _rowIndex = rowIndex;int _colIndex = colIndex;switch (dir){case Direction.None:break;case Direction.Right:_colIndex++;break;case Direction.Left:_colIndex--;break;case Direction.Down:_rowIndex++;break;}//超出网格if (_colIndex < 0 || _colIndex + colCount > Defines.ColCount || _rowIndex + rowCount > Defines.RowCount){return false;}return true;
}

GameManager调用

//用户操作
public void InputCtl()
{if (Input.GetKeyDown(KeyCode.A)){if (currentTetris.IsCanMove(Direction.Left)){currentTetris.MoveByDir(Direction.Left);}}if (Input.GetKeyDown(KeyCode.D)){if (currentTetris.IsCanMove(Direction.Right)){currentTetris.MoveByDir(Direction.Right);}}if (Input.GetKeyDown(KeyCode.S)){if (currentTetris.IsCanMove(Direction.Down)){currentTetris.MoveByDir(Direction.Down);}}
}

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

自由下落

Defines新增常用类

public static readonly float downTime = 1;//下落时间间隔

修改GameManager

float timer;//开始游戏
void OnStartGame()
{timer = Defines.downTime;
}
void Update()
{AutoMoveDown();
}//自动下落
public void AutoMoveDown()
{timer -= Time.deltaTime;if (timer <= 0){timer = Defines.downTime;if (currentTetris.IsCanMove(Direction.Down)){currentTetris.MoveByDir(Direction.Down);}else{//不能移动重新创建currentTetris = CreateTetris();currentTetris.DrawMe();}}
}

效果
在这里插入图片描述

下落后设置对应风格为不可移动类型

MapManager新增方法

//设置不可移动后的俄罗斯方块对应的位置为Static类型
public void SetStatic(TetrisBase t)
{for (int row = 0; row < t.rowCount; row++){for (int col = 0; col < t.colCount; col++){if (t.blockArr[row, col] != BlockType.Empty){int map_rowIndex = row + t.rowIndex;int map_colIndex = col + t.colIndex;ChangeType(map_rowIndex, map_colIndex, BlockType.Static);}}}
}

GameManager调用

if (!currentTetris.IsCanMove(Direction.Down))
{//设置不可移动类型MapManager.Instance.SetStatic(currentTetris);
}

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

检查当前方块是否可以向指定方向移动

解决方块下落重叠的问题

修改俄罗斯方块基类TetrisBase的IsCanMove方法

遍历当前方块的每个单元格,如果单元格不为空且对应最近的地图单元格是静态的(即已经被其他方块占据),则返回false表示不能移动,否则返回true表示可以移动

//是否能移动的方向
public virtual bool IsCanMove(Direction dir)
{int _rowIndex = rowIndex;int _colIndex = colIndex;switch (dir){case Direction.None:break;case Direction.Right:_colIndex++;break;case Direction.Left:_colIndex--;break;case Direction.Down:_rowIndex++;break;}//超出网格if (_colIndex < 0 || _colIndex + colCount > Defines.ColCount || _rowIndex + rowCount > Defines.RowCount){return false;}//检查当前方块是否可以向指定方向移动for (int row = 0; row < rowCount; row++){for (int col = 0; col < colCount; col++){if (blockArr[row, col] != BlockType.Empty){int map_rowIndex = _rowIndex + row;int map_colIndex = _colIndex + col;Block b = MapManager.Instance.blockArr[map_rowIndex, map_colIndex];if (b.type == BlockType.Static){return false;}}}}return true;
}

效果
在这里插入图片描述

旋转逻辑

TetrisBase俄罗斯方块基类新增控制旋转方法

//旋转
public void Rotate()
{//二维数组互换int new_rowCount = colCount;int new_colCount = rowCount;//互换行列后是否超出网格if (rowIndex + new_rowCount > Defines.RowCount || colIndex + new_colCount > Defines.ColCount) return;BlockType[,] tempArr = new BlockType[new_rowCount, new_colCount];for (int row = 0; row < new_rowCount; row++){for (int col = 0; col < new_colCount; col++){tempArr[row, col] = blockArr[new_colCount - 1 - col, row];if (tempArr[row, col] != BlockType.Empty){//对应位置是静态类型static不能旋转if (MapManager.Instance.blockArr[row + this.rowIndex, col + this.colIndex].type == BlockType.Static) return;}}}//擦除WipeMe();rowCount = new_rowCount;colCount = new_colCount;blockArr = tempArr;DrawMe();//画
}

GameManager调用

if (Input.GetKeyDown(KeyCode.W)) currentTetris.Rotate();

效果
在这里插入图片描述

消除逻辑

GameManager新增方法

# 调用
//检测删除行
CheckDelete();//检测删除行
public void CheckDelete()
{//最后一行开始遍历for (int row = Defines.RowCount - 1; row >= 0; row--){int count = 0;//静态类型的个数for(int col = 0; col < Defines.ColCount; col++){BlockType type = MapManager.Instance.blockArr[row, col].type;if (type == BlockType.Static)count++;}if(count == Defines.ColCount){for (int dropRow = row; dropRow > 1; dropRow--){for (int dropCol = 0; dropCol < Defines.ColCount; dropCol++){//上一行类型覆盖当前行BlockType type = MapManager.Instance.blockArr[dropRow - 1, dropCol].type;MapManager.Instance.ChangeType(dropRow, dropCol, type);}}row++;}}
}

效果
在这里插入图片描述

游戏结束逻辑

修改GameManager代码

bool isStop = false;//游戏结束标识//开始游戏
void OnStartGame()
{isStop = false;
}void Update()
{if (isStop == true){return;}
}//当前俄罗斯生成的时候对应位置是不可移动(覆盖)说明游戏结束
public bool IsGameOver()
{for (int row = 0; row < currentTetris.rowCount; row++){for (int col = 0; col < currentTetris.colCount; col++){BlockType type = currentTetris.blockArr[row, col];if (type != BlockType.Empty){int map_rowIndex = row + currentTetris.rowIndex;int map_colIndex = col + currentTetris.colIndex;if (MapManager.Instance.blockArr[map_rowIndex, map_colIndex].type == BlockType.Static) return true;}}}return false;
}

调用

//自动下落
public void AutoMoveDown()
{timer -= Time.deltaTime;if (timer <= 0){timer = Defines.downTime;if (currentTetris.IsCanMove(Direction.Down)){currentTetris.MoveByDir(Direction.Down);}else{//设置不可移动类型MapManager.Instance.SetStatic(currentTetris);//检测删除行CheckDelete();//不能移动重新创建currentTetris = CreateTetris();if (IsGameOver() == true){isStop = true;Debug.Log("game over");return;}currentTetris.DrawMe();}}
}

效果
在这里插入图片描述

怪物生成

修改GameManager代码

//检测删除行
public void CheckDelete()
{//最后一行开始遍历for (int row = Defines.RowCount - 1; row >= 0; row--){//。。。if(count == Defines.ColCount){for (int dropCol = 0; dropCol < Defines.ColCount; dropCol++){//当前行生成哥布林SimpleFactory.CreateModel("gbl", null).transform.position = MapManager.Instance.blockArr[row, dropCol].transform.position;}//。。。}}
}

怪物触碰boss造成伤害和特效,还有游戏结束效果,就自己扩展了,也很简单,还有不同形状的方块

效果
在这里插入图片描述

源码

要啥源码,好好看,好好学!

参考

【视频】https://www.bilibili.com/video/BV1Fr4y1x7mx

完结

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

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

一位在小公司默默奋斗的开发者,出于兴趣爱好,于是最近才开始自习unity。如果你遇到任何问题,也欢迎你评论私信找我, 虽然有些问题我可能也不一定会,但是我会查阅各方资料,争取给出最好的建议,希望可以帮助更多想学编程的人,共勉~
在这里插入图片描述

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

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

相关文章

Java替换 html 中隐藏的空格字符

前言 有时候前端传过来的 json 字符串&#xff0c;包含了隐藏的空格 &NBSP 字符&#xff0c;在后端 Debug 的时候可以看到是 &#xff0c;但 system.out.print() 打印出来的是正常的空格&#xff0c;这样看着正常但其实放入 fastjson 中去做解析会失败&#xff0c;所以我…

U8用友ERP本地部署异地远程访问:内网端口映射外网方案

文章目录 前言1. 服务器本机安装U8并调试设置2. 用友U8借助cpolar实现企业远程办公2.1 在被控端电脑上&#xff0c;点击开始菜单栏&#xff0c;打开设置——系统2.2 找到远程桌面2.3 启用远程桌面 3. 安装cpolar内网穿透3.1 注册cpolar账号3.2 下载cpolar客户端 4. 获取远程桌面…

python使用钉钉机器人给钉钉发送消息

import requestsdef dingmessage(msg):urlhttps://oapi.dingtalk.com/robot/send?access_token2c5e2b764129e936ba9c43713a588caa7eeb168c132223a91ba97d80a6fee337data{msgtype:text,text:{content: 通知:msg}}resrequests.post(url,jsondata)

【数据结构】基于不同策略的英文单词的词频统计和检索系统实验报告

基于不同策略的英文单词的词频统计和检索系统实验报告 实验任务 一篇英文文章存储在一个文本文件中,分别基于线性表、二叉排序树和哈希表不同的存储结构,实现单词词频的统计和单词的检索功能。同时计算不同检索策略下的ASL,通过比较ASL的大小,对不同检索策略的时间性能做出…

界面组件DevExpress WinForms v23.1 - 增强的图表、甘特图功能

DevExpress WinForms拥有180组件和UI库&#xff0c;能为Windows Forms平台创建具有影响力的业务解决方案。DevExpress WinForms能完美构建流畅、美观且易于使用的应用程序&#xff0c;无论是Office风格的界面&#xff0c;还是分析处理大批量的业务数据&#xff0c;它都能轻松胜…

使用sql profile 稳定执行计划的案例

文章目录 1.缘起2.变慢的sql3.检查瓶颈4.解决办法4.1 SQLTXPLAIN 也称为 SQLT4.11 下载coe_xfr_sql_profile.sql4.12 使用方法4.13 执行coe_xfr_sql_profile.sql4.14 执行coe_xfr_sql_profile.sql产生的sql profile文件4.15 验证 4.2 SQL Tuning Advisor方式4.21 第一次Tuning …

冠达管理:Arm上市首日大涨25%,成为年度美股规模最大IPO

9月15日清晨&#xff0c;软银旗下芯片规划公司ARM在纳斯达克交易所首日上市&#xff0c;收盘大涨近25%&#xff0c;市值达到679亿美元&#xff0c;成为本年度美股规模最大的IPO。Arm的美国存托股票开盘价为每股56.1美元&#xff0c;比51美元IPO定价高出10%&#xff0c;随后稳步…

Vue框架中监测数组变化的方法

一 变更方法 调用 push()方法 会直接影响ui变化 <template> <div><ul><li v-for"(item,index) in nums " :key"index"></li></ul> </div> <button click"add">添加数据</button> </…

Talk | ICCV‘23北京通用人工智能研究院黄江勇:ARNOLD-三维场景中基于语言的机器人任务学习

本期为TechBeat人工智能社区第531期线上Talk&#xff01; 北京时间9月14日(周四)20:00&#xff0c; 北京通用人工智能研究院实习研究员—黄江勇的Talk已准时在TechBeat人工智能社区开播&#xff01; 他与大家分享的主题是: “ARNOLD-三维场景中基于语言的机器人任务学习”&…

理解网络通信的基础:OSI七层模型与TCP/IP五层模型

在今天的数字化世界中&#xff0c;网络通信已经成为我们日常生活和商业活动的重要组成部分。为了更好地理解和管理网络通信&#xff0c;网络工程师和管理员使用不同的模型来组织和解释网络协议和通信过程。本文将介绍两种最重要的网络模型&#xff1a;OSI七层模型和TCP/IP五层模…

机器学习实战-系列教程8:SVM分类实战3非线性SVM(鸢尾花数据集/软间隔/线性SVM/非线性SVM/scikit-learn框架)项目实战、代码解读

&#x1f308;&#x1f308;&#x1f308;机器学习 实战系列 总目录 本篇文章的代码运行界面均在Pycharm中进行 本篇文章配套的代码资源已经上传 SVM分类实战1之简单SVM分类 SVM分类实战2线性SVM SVM分类实战3非线性SVM 4、非线性SVM 4.1 创建非线性数据 from sklearn.data…

奶牛个体识别 奶牛身份识别

融合YOLOv5s与通道剪枝算法的奶牛轻量化个体识别方法 Light-weight recognition network for dairy cows based on the fusion of YOLOv5s and channel pruning algorithm 论文链接 知网链接 DOI链接 该文章讨论了奶牛花斑、光照条件、不同剪枝方法、不同剪枝率对准确率的影响…

云原生Kubernetes:pod基础与配置

目录 一、理论 1.pod 2.pod容器分类 3.镜像拉取策略 4.pod 的重启策略 二、实验 1.Pod容器的分类 2.镜像拉取策略 三、问题 1.apiVersion 报错 2.pod v1版本资源未注册 3.格式错误 4.取行显示指定pod信息 四、总结 一、理论 1.pod (1) 概念 Pod是kubernetes中…

python LeetCode 刷题记录 20

题目 给定一个只包括 ‘(’&#xff0c;‘)’&#xff0c;‘{’&#xff0c;‘}’&#xff0c;‘[’&#xff0c;‘]’ 的字符串 s &#xff0c;判断字符串是否有效。 有效字符串需满足&#xff1a; 左括号必须用相同类型的右括号闭合。 左括号必须以正确的顺序闭合。 每个右…

【Java IO流 - 中秋活动特供】流的分类,API使用,文件操作

博主&#xff1a;_LJaXi 专栏&#xff1a; Java | 从跨平台到跨行业 开发工具&#xff1a;IntelliJ IDEA Community Edition 2022.3.3 Java IO流 中秋特供啦 &#x1f96e;Java Io &#x1f354;什么是流流的分类文件字节输入流1. 条件循环解决1 (2) 读取特性 2. 数组存储解决 …

在CIFAR-10数据集上构建ResNet-18模型(pytorch版)

文章目录 1. 构建ResNet模型1.1 前置条件1.2 构建Residual Block1.3 构建ResNet-181.4 模型测试 2. 训练与评估2.1 数据预处理与加载2.2 模型训练2.3 模型评估 Reference 1. 构建ResNet模型 我们将使用PyTorch框架来实现一个简化版的ResNet-18模型。我们的目标是构建一个可以在…

固定资产管理口号标语怎么写

在现代企业管理中&#xff0c;固定资产的管理是至关重要的一环。它不仅关系到企业的经济效益&#xff0c;也影响到企业的运营效率和稳定性。因此&#xff0c;我们需要一种既富有创意又实用有效的口号来引导我们的固定资产管理工作。 明确一个观点  我们要明确一个观点&#…

flink on yarn任务中文乱码问题解决记录

开发反馈预生产部分部分flink任务出现中文乱码的问题 找到乱码的flink任务所在的节点&#xff0c;登录服务器&#xff0c;执行locale命令&#xff1a; 发现是locale没有设置好&#xff0c;使用vim编辑文本&#xff0c;写入中文都直接乱码 对比其他几台机器&#xff0c;发现主…

MySQL优化第二篇

MySQL优化第二篇 性能分析小表驱动大表慢查询日志日志分析工具mysqldumpslow Show Profile进行SQL分析&#xff08;重中之重&#xff09; 七种JOIN 1、inner join &#xff1a;可以简写为join&#xff0c;表示的是交集&#xff0c;也就是两张表的共同数据 sql语句&#xff1a…

文心一言插件开发全流程,ERNIE-Bot-SDK可以调用文心一言的能力

文心一言插件开发 前言插件插件是什么工作原理申请开发权限 开始第一步&#xff1a;安装python第二步&#xff1a;搭建项目manifest 描述文件&#xff1a;ai-plugin.json插件服务描述文件&#xff1a;openapi.yaml开发自己的plugin-server 第三步&#xff1a;上传插件 SDK相关链…