This commit is contained in:
2025-11-26 15:17:27 +08:00
commit a8e4f56999
350 changed files with 25023 additions and 0 deletions

103
posts/hello-world.md Normal file
View File

@@ -0,0 +1,103 @@
---
title: HelloWorld
date: 2024-04-16
tags: [HelloWorld, vue, vitepress]
pinned: true
head:
- - meta
- name: description
content: vitepress-theme-bluearchive HelloWorld
- - meta
- name: keywords
content: vitepress theme bluearchive HelloWorld
---
只是一个 HelloWorld
---
# Markdown Extension Examples
This page demonstrates some of the built-in markdown extensions provided by VitePress.
## Syntax Highlighting
VitePress provides Syntax Highlighting powered by [Shiki](https://github.com/shikijs/shiki), with additional features like line-highlighting:
**Input**
````md
```js{4}
export default {
data () {
return {
msg: 'Highlighted!'
}
}
}
```
````
**Output**
```js{4}
export default {
data () {
return {
msg: 'Highlighted!'
}
}
}
```
## Custom Containers
**Input**
```md
::: info
This is an info box.
:::
::: tip
This is a tip.
:::
::: warning
This is a warning.
:::
::: danger
This is a dangerous warning.
:::
::: details
This is a details block.
:::
```
**Output**
::: info
This is an info box.
:::
::: tip
This is a tip.
:::
::: warning
This is a warning.
:::
::: danger
This is a dangerous warning.
:::
::: details
This is a details block.
:::
## More
Check out the documentation for the [full list of markdown extensions](https://vitepress.dev/guide/markdown).

31
posts/images.md Normal file
View File

@@ -0,0 +1,31 @@
---
title: Images
date: 2013-12-26
tags: [image]
head:
- - meta
- name: description
content: vitepress-theme-bluearchive Images
- - meta
- name: keywords
content: vitepress theme bluearchive Images
---
This is a image test post.
---
::: tip
img 标签的图片灯箱效果需要加入属性选择器:
```md
<img src="/image/wallpaper-2572384.webp" data-fancybox="gallery"/>
```
:::
> `![](/image/wallpaper-2572384.webp)` ![](/image/wallpaper-2572384.webp) `<img src="/image/wallpaper-2572384.webp" data-fancybox="gallery"/>` <img src="/image/wallpaper-2572384.webp" data-fancybox="gallery"/>
![Caption](/image/wallpaper-2311325.webp)
![](/image/wallpaper-878514.webp)

3
posts/index.md Normal file
View File

@@ -0,0 +1,3 @@
---
title: 文章详情
---

394
posts/markdown.md Normal file
View File

@@ -0,0 +1,394 @@
---
title: Markdown Style test
date: 2018-07-24
tags: [Foo, Bar]
head:
- - meta
- name: description
content: vitepress-theme-bluearchive Markdown Style test
- - meta
- name: keywords
content: vitepress theme bluearchive Markdown Style test
---
This post is originated from https://gist.github.com/apackeer/4159268 and is used for testing markdown style. This post contains nearly every markdown usage. Make sure all the markdown elements below show up correctly.
---
## Headers
```markdown
# H1
## H2
### H3
#### H4
##### H5
###### H6
Alternatively, for H1 and H2, an underline-ish style:
# Alt-H1
## Alt-H2
```
# H1
## H2
### H3
#### H4
##### H5
###### H6
Alternatively, for H1 and H2, an underline-ish style:
# Alt-H1
## Alt-H2
## Emphasis
```markdown
Emphasis, aka italics, with _asterisks_ or _underscores_.
Strong emphasis, aka bold, with **asterisks** or **underscores**.
Combined emphasis with **asterisks and _underscores_**.
Strikethrough uses two tildes. ~~Scratch this.~~
```
Emphasis, aka italics, with _asterisks_ or _underscores_.
Strong emphasis, aka bold, with **asterisks** or **underscores**.
Combined emphasis with **asterisks and _underscores_**.
Strikethrough uses two tildes. ~~Scratch this.~~
## Lists
```markdown
1. First ordered list item
2. Another item
- Unordered sub-list.
1. Actual numbers don't matter, just that it's a number
1. Ordered sub-list
1. And another item.
You can have properly indented paragraphs within list items. Notice the blank line above, and the leading spaces (at least one, but we'll use three here to also align the raw Markdown).
To have a line break without a paragraph, you will need to use two trailing spaces.
Note that this line is separate, but within the same paragraph.
(This is contrary to the typical GFM line break behaviour, where trailing spaces are not required.)
- Unordered list can use asterisks
* Or minuses
- Or pluses
* Paragraph In unordered list
For example like this.
Common Paragraph with some text.
And more text.
```
1. First ordered list item
2. Another item
- Unordered sub-list.
1. Actual numbers don't matter, just that it's a number
1. Ordered sub-list
1. And another item.
You can have properly indented paragraphs within list items. Notice the blank line above, and the leading spaces (at least one, but we'll use three here to also align the raw Markdown).
To have a line break without a paragraph, you will need to use two trailing spaces.
Note that this line is separate, but within the same paragraph.
(This is contrary to the typical GFM line break behaviour, where trailing spaces are not required.)
- Unordered list can use asterisks
* Or minuses
- Or pluses
* Paragraph In unordered list
For example like this.
Common Paragraph with some text.
And more text.
## Inline HTML
```markdown
<p>To reboot your computer, press <kbd>ctrl</kbd>+<kbd>alt</kbd>+<kbd>del</kbd>.</p>
```
<p>To reboot your computer, press <kbd>ctrl</kbd>+<kbd>alt</kbd>+<kbd>del</kbd>.</p>
```markdown
<dl>
<dt>Definition list</dt>
<dd>Is something people use sometimes.</dd>
<dt>Markdown in HTML</dt>
<dd>Does *not* work **very** well. Use HTML <em>tags</em>.</dd>
</dl>
```
<dl>
<dt>Definition list</dt>
<dd>Is something people use sometimes.</dd>
<dt>Markdown in HTML</dt>
<dd>Does *not* work **very** well. Use HTML <em>tags</em>.</dd>
</dl>
## Links
```markdown
[I'm an inline-style link](https://www.google.com)
[I'm an inline-style link with title](https://www.google.com "Google's Homepage")
[I'm a reference-style link][Arbitrary case-insensitive reference text]
[I'm a relative reference to a repository file](../blob/master/LICENSE)
[You can use numbers for reference-style link definitions][1]
Or leave it empty and use the [link text itself]
Some text to show that the reference links can follow later.
[arbitrary case-insensitive reference text]: https://hexo.io
[1]: https://hexo.io/docs/
[link text itself]: https://hexo.io/api/
```
[I'm an inline-style link](https://www.google.com)
[I'm an inline-style link with title](https://www.google.com "Google's Homepage")
[I'm a reference-style link][Arbitrary case-insensitive reference text]
[I'm a relative reference to a repository file](../blob/master/LICENSE)
[You can use numbers for reference-style link definitions][1]
Or leave it empty and use the [link text itself]
Some text to show that the reference links can follow later.
[arbitrary case-insensitive reference text]: https://hexo.io
[1]: https://hexo.io/docs/
[link text itself]: https://hexo.io/api/
## Images
```markdown
hover to see the title text:
Inline-style:
![alt text](https://hexo.io/icon/favicon-196x196.png 'Logo Title Text 1')
Reference-style:
![alt text][logo]
[logo]: https://hexo.io/icon/favicon-196x196.png 'Logo Title Text 2'
```
hover to see the title text:
Inline-style:
![alt text](https://hexo.io/icon/favicon-196x196.png 'Logo Title Text 1')
Reference-style:
![alt text][logo]
[logo]: https://hexo.io/icon/favicon-196x196.png 'Logo Title Text 2'
## Code and Syntax Highlighting
Inline `code` has `back-ticks around` it.
```javascript
var s = 'JavaScript syntax highlighting'
alert(s)
```
```python
s = "Python syntax highlighting"
print s
```
```
No language indicated, so no syntax highlighting.
But let's throw in a <b>tag</b>.
```
## Tables
```markdown
| | ASCII | HTML |
| ---------------- | ------------------------------- | ----------------------------- |
| Single backticks | `'Isn't this fun?'` | 'Isn't this fun?' |
| Quotes | `"Isn't this fun?"` | "Isn't this fun?" |
| Dashes | `-- is en-dash, --- is em-dash` | -- is en-dash, --- is em-dash |
```
| | ASCII | HTML |
| ---------------- | ------------------------------- | ----------------------------- |
| Single backticks | `'Isn't this fun?'` | 'Isn't this fun?' |
| Quotes | `"Isn't this fun?"` | "Isn't this fun?" |
| Dashes | `-- is en-dash, --- is em-dash` | -- is en-dash, --- is em-dash |
Colons can be used to align columns.
```markdown
| Tables | Are | Cool |
| ------------- | :-----------: | ---: |
| col 3 is | right-aligned | |
| col 2 is | centered | |
| zebra stripes | are neat |
```
| Tables | Are | Cool |
| ------------- | :-----------: | ---: |
| col 3 is | right-aligned | |
| col 2 is | centered | |
| zebra stripes | are neat | |
The outer pipes (|) are optional, and you don't need to make the raw Markdown line up prettily. You can also use inline Markdown.
```markdown
| Markdown | Less | Pretty |
| -------- | --------- | ---------- |
| _Still_ | `renders` | **nicely** |
| 1 | 2 | 3 |
```
| Markdown | Less | Pretty |
| -------- | --------- | ---------- |
| _Still_ | `renders` | **nicely** |
| 1 | 2 | 3 |
> You can find more information about **LaTeX** mathematical expressions [here](https://math.meta.stackexchange.com/questions/5020/mathjax-basic-tutorial-and-quick-reference).
## Blockquotes
> Blockquotes are very handy in email to emulate reply text.
> This line is part of the same quote.
Quote break.
> This is a very long line that will still be quoted properly when it wraps. Oh boy let's keep writing to make sure this is long enough to actually wrap for everyone. Oh, you can _put_ **Markdown** into a blockquote.
## Horizontal Rule
Three or more...
```markdown
---
Hyphens
---
Asterisks
---
Underscores
```
---
Hyphens
---
Asterisks
---
Underscores
## Line Breaks
```markdown
Here's a line for us to start with.
This line is separated from the one above by two newlines, so it will be a _separate paragraph_.
This line is also a separate paragraph, but...
This line is only separated by a single newline, so it's a separate line in the _same paragraph_.
```
Here's a line for us to start with.
This line is separated from the one above by two newlines, so it will be a _separate paragraph_.
This line is also a separate paragraph, but...
This line is only separated by a single newline, so it's a separate line in the _same paragraph_.
---
```markdown
This is a regular paragraph.
<table>
<tr>
<td>Foo</td>
</tr>
</table>
This is another regular paragraph.
```
This is a regular paragraph.
<table>
<tr>
<td>Foo</td>
</tr>
</table>
This is another regular paragraph.
## Youtube videos
```markdown
<a href="https://www.youtube.com/watch?feature=player_embedded&v=ARted4RniaU
" target="_blank"><img src="https://img.youtube.com/vi/ARted4RniaU/0.jpg"
alt="IMAGE ALT TEXT HERE" width="240" height="180" border="10" /></a>
Pure markdown version:
[![IMAGE ALT TEXT HERE](https://img.youtube.com/vi/ARted4RniaU/0.jpg)](https://www.youtube.com/watch?v=ARted4RniaU)
```
<a href="https://www.youtube.com/watch?feature=player_embedded&v=ARted4RniaU
" target="_blank"><img src="https://img.youtube.com/vi/ARted4RniaU/0.jpg"
alt="IMAGE ALT TEXT HERE" width="240" height="180" border="10" /></a>
Pure markdown version:
[![IMAGE ALT TEXT HERE](https://img.youtube.com/vi/ARted4RniaU/0.jpg)](https://www.youtube.com/watch?v=ARted4RniaU)

182
posts/studycase1.md Normal file
View File

@@ -0,0 +1,182 @@
---
title: StudyCase1
date: 2025-11-25 15:35
tags: [studycase, unity]
pinned: true
head:
- - meta
- name: description
content: vitepress-theme-bluearchive StudyCase1
- - meta
- name: keywords
content: vitepress theme bluearchive StudyCase1
---
# 第三人称角色控制器
## 编辑器
- **Unity 2022.3.62f2**
- **Visual Studio 2022**
## 课程目标
- **鼠标控制视角旋转**
- **WASD控制模型移动**
- **空格控制跳跃**
## 演示视频
<video id="vdMain" controls muted poster="/video/studycase1/演示视频.png" playsinline>
<source id="vSource" src="/video/studycase1/演示视频.mp4" type="video/mp4" />
</video>
[项目地址](http://home.gtuantuan.online:8300/TuanTuan/StudyCase)
## 课前准备
### 新建项目
- 创建URP项目
<img src="/image/studycase1/创建URP项目.png" data-fancybox="gallery"/>
- 移除Readme
<img src="/image/studycase1/移除Readme.png" data-fancybox="gallery"/>
- 新建场景或者修改初始场景为StudyCase1
<img src="/image/studycase1/创建StudyCase1场景.png" data-fancybox="gallery"/>
### 安装 Input System 与 Cinemachine
- 打开 Package Manager
<img src="/image/studycase1/打开PackageManager.png" data-fancybox="gallery"/>
- 切换到 Unity Registry
<img src="/image/studycase1/切换到UnityRegistry.png" data-fancybox="gallery"/>
- 安装 `Input System``Cinemachine`
<img src="/image/studycase1/安装俩个包.png" data-fancybox="gallery"/>
- 导入示例
<img src="/image/studycase1/导入示例.png" data-fancybox="gallery"/>
- 创建初始场景(StudyCase1)
<img src="/image/studycase1/创建初始场景.png" data-fancybox="gallery"/>
- 从示例项目导入模型到场景
<img src="/image/studycase1/从示例项目导入模型到场景.png" data-fancybox="gallery"/>
> 提示:安装 Input System 后Unity 会提示重启并切换至新输入系统,务必确认。
## 课堂任务
### 添加虚拟相机根节点
- 为相机添加 `CinemachineBrain`作为根节点以便统一控制
<img src="/image/studycase1/添加虚拟相机根节点.png" data-fancybox="gallery"/>
### 创建玩家节点
- 创建 `Player` 空节点,创建`Forward``Model`空节点并作为`Player`子节点以及虚拟相机
- 注意`Forward``Model`的尽量不要有偏移
<img src="/image/studycase1/创建玩家层级.png" data-fancybox="gallery"/>
- 创建胶囊体和正方体作为`Model`的子物体,可以去掉碰撞器,尽量不要有偏移
<img src="/image/studycase1/玩家节点.png" data-fancybox="gallery"/>
### 配置虚拟相机
- 将虚拟相机 `Follow``LookAt` 指向玩家模型,调整 Body/ Aim使镜头保持第三人称视角
<img src="/image/studycase1/配置虚拟相机.png" data-fancybox="gallery"/>
### 创建 InputActions
- 在项目窗口右键 `Create > Input Actions`,命名为 `PlayerInputActions`
<img src="/image/studycase1/创建InputActions.png" data-fancybox="gallery"/>
- 创建 `Player` Action Map添加 `Move`Vector2`Jump`Button
<img src="/image/studycase1/创建playerinputactions.png" data-fancybox="gallery"/>
- Move 绑定 `WASD` Jump 绑定 `space`
<img src="/image/studycase1/创建4向绑定.png" data-fancybox="gallery"/>
<img src="/image/studycase1/绑定wasd.png" data-fancybox="gallery"/>
### 编写脚本`ThirdCharacterController.cs`
-`Assets\Scripts\StudyCase1` 下创建脚本 `ThirdCharacterController`
```csharp
using UnityEngine;
using UnityEngine.InputSystem;
namespace StudyCase1
{
public class ThirdCharacterController : MonoBehaviour
{
public CharacterController characterController;
public Transform forward;
public Transform model;
public Cinemachine.CinemachineVirtualCamera vCam;
public float moveSpeed = 5f;
public float jumpSpeed = 2f;
public float turnSpeed = 10f;
public float gravity = 10f;
Vector3 moveDir;
Vector2 moveInput;
private void Update()
{
moveDir = new Vector3(moveInput.x, moveDir.y, moveInput.y);
forward.eulerAngles = new Vector3(0, vCam.transform.eulerAngles.y, 0);
moveDir = forward.TransformDirection(moveDir);
if (moveInput != Vector2.zero)
{
Quaternion target = Quaternion.LookRotation(new Vector3(moveDir.x, 0, moveDir.z));
model.rotation = Quaternion.Slerp(model.rotation, target, turnSpeed * Time.deltaTime);
}
if (!characterController.isGrounded)
moveDir.y -= gravity * Time.deltaTime;
characterController.Move(moveDir * moveSpeed * Time.deltaTime);
}
public void OnMove(InputAction.CallbackContext context)
{
if (characterController.isGrounded)
moveInput = context.ReadValue<Vector2>();
else moveInput = Vector2.zero;
}
public void OnJump(InputAction.CallbackContext context)
{
if (context.performed && characterController.isGrounded)
{
moveDir.y = jumpSpeed;
}
}
}
}
```
### 代码讲解
- **namespace StudyCase1**:因为可能出现同名文件
- **forward**:作为“参照物”同步虚拟相机的 Y 轴旋转,用来转换输入的坐标轴。
- **moveDir**:在本地坐标系下计算移动向量,并通过 `CharacterController.Move` 驱动。
- **OnMove/OnJump**:直接使用 Input System 回调,确保只有在贴地时才写入输入,避免空中漂移。
- **旋转插值**`Quaternion.Slerp` 让角色转身更加顺滑,可根据手感微调 `turnSpeed`
### Player节点设置
- 挂载`ThirdCharacterController`
<img src="/image/studycase1/挂载ThirdCharacterController.png" data-fancybox="gallery"/>
- 添加组件`PlayerInput`
<img src="/image/studycase1/添加组件PlayerInput.png" data-fancybox="gallery"/>
## 常见问题速查
- **角色不动**:确认 `CharacterController` 已赋值且 `Move` Action Map 激活。
- **镜头不同步**:检查 `forward` 对象是否正确引用虚拟相机的朝向,检查模型和`player`是否偏移过大。
- **跳跃失效**:确认 `Jump` 绑定的动作类型为 `Button`,确认角色是否在地上。
- **移动时会旋转镜头**:确认虚拟相机是在 `Player` 节点下,不是在 `Model` 节点下。
完成以上步骤,即可得到一个可拓展的第三人称基础模板。

171
posts/studycase2.md Normal file
View File

@@ -0,0 +1,171 @@
---
title: StudyCase2
date: 2025-11-25 15:38
tags: [studycase, unity]
pinned: true
head:
- - meta
- name: description
content: vitepress-theme-bluearchive StudyCase2
- - meta
- name: keywords
content: vitepress theme bluearchive StudyCase2
---
# 绑定动画
## 编辑器
- **Unity 2022.3.62f2**
- **Visual Studio 2022**
## 课程目标
- **控制器绑定动画**
## 演示视频
<video id="vdMain" controls muted poster="/video/studycase2/演示视频.png" playsinline>
<source id="vSource" src="/video/studycase2/演示视频.mp4" type="video/mp4" />
</video>
[项目地址](http://home.gtuantuan.online:8300/TuanTuan/StudyCase)
## 课前准备
### 1. 导入FBX模型导入shader
- 新健文件夹导入FBX
<img src="/image/studycase2/新健文件夹导入FBX.png" data-fancybox="gallery"/>
- 导入shader
<img src="/image/studycase2/导入shader.png" data-fancybox="gallery"/>
## 课堂任务
### 模型处理
- 导出FBX材质球到Mats文件夹方便修改
<img src="/image/studycase2/导出材质.png" data-fancybox="gallery"/>
- 替换模型材质Shader
<img src="/image/studycase2/嘴部材质特殊处理.png" data-fancybox="gallery"/>
- 嘴巴贴图特殊处理
<img src="/image/studycase2/嘴巴贴图特殊处理.png" data-fancybox="gallery"/>
- 属于脸部材质需勾选isFace嘴部材质特殊处理
<img src="/image/studycase2/嘴部材质特殊处理.png" data-fancybox="gallery"/>
### 用模型替换之前的胶囊体
- 替换模型
<img src="/image/studycase2/替换模型.png" data-fancybox="gallery"/>
- 调整模型大小和位置
<img src="/image/studycase2/调整模型大小和位置.png" data-fancybox="gallery"/>
### 创建动画控制器添加Idle和Move动画片段
- 创建动画控制器
<img src="/image/studycase2/创建动画控制器.png" data-fancybox="gallery"/>
- 模型节点添加动画控制器组件
<img src="/image/studycase2/模型节点添加动画控制器组件.png" data-fancybox="gallery"/>
- 打开动画控制器界面Idle作为默认动画
<img src="/image/studycase2/Idle作为默认动画.png" data-fancybox="gallery"/>
- 添加移动动画创建连接创建bool参数
<img src="/image/studycase2/添加移动动画创建连接创建bool参数.png" data-fancybox="gallery"/>
- moving和idle设置为循环播放
<img src="/image/studycase2/moving和idle设置为循环播放.png" data-fancybox="gallery"/>
### 创建状态条件
- 设置idle到moving的条件
<img src="/image/studycase2/设置idle到moving的条件.png" data-fancybox="gallery"/>
- 设置moving到move end的条件
<img src="/image/studycase2/设置moving到move end的条件.png" data-fancybox="gallery"/>
- 设置move end到moving的条件的条件
<img src="/image/studycase2/设置move end到moving的条件.png" data-fancybox="gallery"/>
### 编写脚本`ThirdCharacterController.cs`
-`Assets\Scripts\StudyCase2` 下创建脚本 `ThirdCharacterController`
```csharp
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.InputSystem;
namespace StudyCase2
{
public class ThirdCharacterController : MonoBehaviour
{
public CharacterController characterController;
public Animator animator;
public Transform forward;
public Transform model;
public Cinemachine.CinemachineVirtualCamera vCam;
public float moveSpeed = 5f;
public float jumpSpeed = 2f;
public float turnSpeed = 10f;
public float gravity = 10f;
Vector3 moveDir;
Vector2 moveInput;
private void Update()
{
moveDir = new Vector3(moveInput.x, moveDir.y, moveInput.y);
forward.eulerAngles = new Vector3(0, vCam.transform.eulerAngles.y, 0);
moveDir = forward.TransformDirection(moveDir);
if (moveInput != Vector2.zero)
{
animator?.SetBool("Move", true);
Quaternion target = Quaternion.LookRotation(new Vector3(moveDir.x, 0, moveDir.z));
model.rotation = Quaternion.Slerp(model.rotation, target, turnSpeed * Time.deltaTime);
}
else animator?.SetBool("Move", false);
if (!characterController.isGrounded)
moveDir.y -= gravity * Time.deltaTime;
characterController.Move(moveDir * moveSpeed * Time.deltaTime);
}
public void OnMove(InputAction.CallbackContext context)
{
if (characterController.isGrounded)
moveInput = context.ReadValue<Vector2>();
else moveInput = Vector2.zero;
}
public void OnJump(InputAction.CallbackContext context)
{
if (context.performed && characterController.isGrounded)
{
moveDir.y = jumpSpeed;
}
}
}
}
```
### 代码讲解
```csharp
//获取动画控制器
public Animator animator;
```
```csharp
//设置动画控制器参数
//true播放Moveing动画
//false播放Move end动画然后回到Idle
animator.SetBool("Move", true);
```
### Player节点设置
- 新增 `Animator` ,其他同StudyCase1
完成以上步骤,即可得到一个带动画的第三人称控制器。

16
posts/tags.md Normal file
View File

@@ -0,0 +1,16 @@
---
title: Tags
date: 2013-12-24 23:29:53
tags: [Foo, Bar, Baz]
head:
- - meta
- name: description
content: vitepress-theme-bluearchive Tags
- - meta
- name: keywords
content: vitepress theme bluearchive Tags
---
This post contains 3 tags. Make sure your theme can display all of the tags.
---