ExportedComplexStrings.cs 847 B

1234567891011121314151617181920212223242526
  1. using Godot;
  2. namespace Godot.SourceGenerators.Sample
  3. {
  4. public partial class ExportedComplexStrings : Node
  5. {
  6. [Export]
  7. private string _fieldInterpolated1 = $"The quick brown fox jumps over ({Engine.GetVersionInfo()})";
  8. [Export]
  9. private string _fieldInterpolated2 = $"The quick brown fox jumps over ({Engine.GetVersionInfo()["major"],0:G}) the lazy dog.";
  10. [Export]
  11. private string _fieldInterpolated3 = $"{((int)Engine.GetVersionInfo()["major"]) * -1 * -1:G} the lazy dog.";
  12. [Export]
  13. private string _fieldInterpolated4 = $"{":::fff,,}<,<}},,}]"}";
  14. [Export]
  15. public string PropertyInterpolated1
  16. {
  17. get;
  18. private set;
  19. } = $"The quick brown fox jumps over {GD.VarToStr($"the lazy {Engine.GetVersionInfo()} do")}g.";
  20. }
  21. }