Skip to content

Commit

Permalink
笔记微调
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashiamd committed Jul 28, 2024
1 parent 786ad74 commit e69b409
Show file tree
Hide file tree
Showing 5 changed files with 84 additions and 66 deletions.
12 changes: 12 additions & 0 deletions docs/study/Game-dev/GDScript基础-学习笔记.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# GDScript基础-学习笔记

> [GDScript - GDScript 基础 - 《Godot 游戏引擎 v3.5 中文文档》 - 书栈网 · BookStack](https://www.bookstack.cn/read/godot-3.5-zh/f9c328f5c1cf8c98.md)
>
> 以前学过JavaScript和Python,所以这里就不特地写全面的笔记了。
1. GDScript支持鸭子类型

2. GDScript继承Refrence的引用类型在计数为0时会自动释放,继承Object则需要手动管理内存

3. 一般开发时最基础的类只用到`RefCounted`,再往下的类需要手动内存管理,比较繁琐
4.
20 changes: 19 additions & 1 deletion docs/study/Game-dev/Godot(官方教程)-学习笔记.md
Original file line number Diff line number Diff line change
@@ -1 +1,19 @@
# Godot(官方教程)-学习笔记
# Godot(官方教程)-学习笔记

> [Introduction — Godot Engine (stable) documentation in English](https://docs.godotengine.org/en/stable/about/introduction.html)
>
> [Learn Godot's GDScript From Zero by GDQuest, Xananax (itch.io)](https://gdquest.itch.io/learn-godot-gdscript)
>
> [Godot文件- 主 分支 — Godot Engine latest 文档 (osgeo.cn)](https://www.osgeo.cn/godot/index.html)
>
> [Vignette - Godot Shaders](https://godotshaders.com/shader/vignette/)
1. Godot默认子节点ready之后,才会ready父节点。如果需要在子节点中直接或间接调用到父节点的onready变量,就会报错。可以通过`await owner.ready ` 先等待父节点ready
2. `@export`变量在`__init__`之后,`_ready()`方法之前初始化,在`_ready()`可以安全访问
3. `@onready`变量在`_ready()`方法中由Godot自动初始化
4. 普通变量的初始化在`@export`变量之前
5. 初始化顺序:`普通var` > `@export` > `@onready`
6. Godot制作2D像素游戏,纹理大小Rect宽高最好设置为偶数,避免图片在相机移动时发生抖动
7. input输入事件传播的调用链(注意,输入事件的传播和输入状态查询`Input.get_axis("move_left")`是两套系统):`_input()`>`_gui_input()`>`_shortcut_input()`>`unhandled_key_input()`>`_unhandled_input()`>其他逻辑。按照上述顺序,<u>前面的函数没有处理逻辑则继续向后检测处理逻辑</u>。

8.
Loading

0 comments on commit e69b409

Please sign in to comment.