GlobalClass.GD0401.cs 444 B

12345678910111213141516171819202122
  1. using Godot;
  2. // This works because it inherits from GodotObject.
  3. [GlobalClass]
  4. public partial class CustomGlobalClass1 : GodotObject
  5. {
  6. }
  7. // This works because it inherits from an object that inherits from GodotObject
  8. [GlobalClass]
  9. public partial class CustomGlobalClass2 : Node
  10. {
  11. }
  12. // This raises a GD0401 diagnostic error: global classes must inherit from GodotObject
  13. [GlobalClass]
  14. public partial class {|GD0401:CustomGlobalClass3|}
  15. {
  16. }