加载资源

需要先将对应的脚本加载。

CS
GDScript gds = GD.Load<GDScript>("res://xxx.gd");
点击展开查看更多
GDSCRIPT
var cs = load("res://xxx.cs")
点击展开查看更多

静态成员

CS
gds.Get("属性名");
gds.Set("属性名", );
gds.Call("函数名", 参数);
点击展开查看更多
GDSCRIPT
cs.属性名
cs.属性名 = 
cs.函数名(参数)
点击展开查看更多

实例化

CS
Node node = (Node)gds.New(); // 自行转换类型
点击展开查看更多
GDSCRIPT
var node = cs.new()
点击展开查看更多

版权声明

作者: Chaim

链接: https://chaim.eu.org/posts/csharp-%E5%92%8C-gdscript-%E4%BA%92%E7%9B%B8%E8%B0%83%E7%94%A8/

许可证: CC BY-NC-SA 4.0

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. Please attribute the source, use non-commercially, and maintain the same license.

开始搜索

输入关键词搜索文章内容

↑↓
ESC
⌘K 快捷键