加载资源

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

  • C# 加载 GDScript
CS
GDScript gds = GD.Load<GDScript>("res://xxx.gd");
  • GDScript 加载 C#
GDSCRIPT
var cs = load("res://xxx.cs")

静态成员

  • C#
CS
gds.Get("属性名");
gds.Set("属性名", 值);
gds.Call("函数名", 参数);
  • GDScript
GDSCRIPT
cs.属性名
cs.属性名 = 值
cs.函数名(参数)

实例化

  • C#
CS
Node node = (Node)gds.New(); // 自行转换类型
  • GDScript
GDSCRIPT
var node = cs.new()

: Cheyne Xie

: https://chaim.eu.org/posts/3660b4f7/

: 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.