obsidian/笔记文件/2.笔记/第三人称角色控制_第一章.md
2025-03-26 00:02:56 +08:00

75 lines
1.3 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

一些方案对比
![[Pasted image 20240305124837.png]]
动作游戏 需求和优点:
![[Pasted image 20240305125350.png]]
游戏开始菜单:
UI界面
![[Pasted image 20240305132231.png]]
对应脚本:
![[Pasted image 20240305132201.png]]
也是统一管理资源的:
![[Pasted image 20240305133613.png]]
运行游戏鼠标控制视角wasd或方向键控制移动
![[Pasted image 20240305132414.png]]
特性说明:
![[Pasted image 20240305133350.png]]
先整一个新颜色
![[Pasted image 20240305133808.png]]
存储颜色
重写获取哈希值的方式
![[Pasted image 20240305134025.png]]
存储为浮点数值,构造函数里面,进行赋值
![[Pasted image 20240305142511.png]]
字典和方向向量,也是同理,需要序列化
逻辑基本一样
![[Pasted image 20240305142813.png]]
这个标签指的是,不用序列化
![[Pasted image 20240305143335.png]]
序列化字典实际上是把key和value分别存到两个list结构
真正序列化的是这俩list结构
![[Pasted image 20240305143748.png]]
序列化的逻辑:
![[Pasted image 20240305143935.png]]
反序列化的逻辑:
![[Pasted image 20240305144127.png]]
使用:
![[Pasted image 20240305144350.png]]
颜色序列化相关,调用:
![[Pasted image 20240305144617.png]]