加载资源

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

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

开始搜索

输入关键词搜索文章内容

↑↓
ESC
⌘K 快捷键