initial commit, 4.5 stable
Some checks failed
🔗 GHA / 📊 Static checks (push) Has been cancelled
🔗 GHA / 🤖 Android (push) Has been cancelled
🔗 GHA / 🍏 iOS (push) Has been cancelled
🔗 GHA / 🐧 Linux (push) Has been cancelled
🔗 GHA / 🍎 macOS (push) Has been cancelled
🔗 GHA / 🏁 Windows (push) Has been cancelled
🔗 GHA / 🌐 Web (push) Has been cancelled

This commit is contained in:
2025-09-16 20:46:46 -04:00
commit 9d30169a8d
13378 changed files with 7050105 additions and 0 deletions

View File

@@ -0,0 +1,68 @@
[*.{sln,csproj}]
end_of_line = crlf
charset = utf-8-bom
[*.{csproj,props,targets,nuspec,resx}]
indent_style = space
indent_size = 2
[*.cs]
indent_style = space
csharp_indent_case_contents_when_block = false
csharp_new_line_before_open_brace = all
csharp_new_line_before_else = true
csharp_new_line_before_catch = true
csharp_new_line_before_finally = true
csharp_new_line_before_members_in_object_initializers = true
csharp_new_line_before_members_in_anonymous_types = true
dotnet_style_require_accessibility_modifiers = always
# Diagnostics to prevent defensive copies of `in` struct parameters
resharper_possibly_impure_method_call_on_readonly_variable_highlighting = error
# IDE0040: Add accessibility modifiers
dotnet_diagnostic.IDE0040.severity = warning
# IDE1006: Naming rule violation
dotnet_diagnostic.IDE1006.severity = suggestion
# Severity levels for dotnet_naming_rule only affect IDE environments.
# To have them extra visible to people, we can set them as 'warning' here without affecting compilation.
# Everything should be PascalCase by default
dotnet_naming_rule.all_should_be_camel_case.severity = warning
dotnet_naming_rule.all_should_be_camel_case.symbols = all
dotnet_naming_rule.all_should_be_camel_case.style = pascal_case_style
# Non-public fields should be _camelCase
dotnet_naming_rule.non_public_fields_should_be_underscore_camel_case.severity = warning
dotnet_naming_rule.non_public_fields_should_be_underscore_camel_case.symbols = non_public_fields
dotnet_naming_rule.non_public_fields_should_be_underscore_camel_case.style = underscore_camel_case_style
# Constant fields (and local vars) should be PascalCase
dotnet_naming_rule.constants_should_be_pascal_case.severity = warning
dotnet_naming_rule.constants_should_be_pascal_case.symbols = constants
dotnet_naming_rule.constants_should_be_pascal_case.style = pascal_case_style
# Locals variables should be camelCase
dotnet_naming_rule.local_vars_should_be_camel_case.severity = warning
dotnet_naming_rule.local_vars_should_be_camel_case.symbols = local_vars
dotnet_naming_rule.local_vars_should_be_camel_case.style = camel_case_style
# Parameters should be camelCase
dotnet_naming_rule.parameters_should_be_camel_case.severity = warning
dotnet_naming_rule.parameters_should_be_camel_case.symbols = parameters
dotnet_naming_rule.parameters_should_be_camel_case.style = camel_case_style
dotnet_naming_symbols.all.applicable_kinds = *
dotnet_naming_symbols.local_vars.applicable_kinds = local
dotnet_naming_symbols.parameters.applicable_kinds = parameter
dotnet_naming_symbols.constants.applicable_kinds = field, local
dotnet_naming_symbols.constants.required_modifiers = const
dotnet_naming_symbols.non_public_fields.applicable_kinds = field
dotnet_naming_symbols.non_public_fields.applicable_accessibilities = private, protected, private_protected
dotnet_naming_style.camel_case_style.capitalization = camel_case
dotnet_naming_style.camel_case_style.required_prefix =
dotnet_naming_style.underscore_camel_case_style.capitalization = camel_case
dotnet_naming_style.underscore_camel_case_style.required_prefix = _
dotnet_naming_style.pascal_case_style.capitalization = pascal_case
dotnet_naming_style.pascal_case_style.required_prefix =

5
modules/mono/.gitignore vendored Normal file
View File

@@ -0,0 +1,5 @@
# Do not ignore solution files inside the mono module. Overrides Godot's global gitignore.
!*.sln
# Generated by build_assemblies.py.
SdkPackageVersions.props

View File

@@ -0,0 +1,6 @@
<Project>
<PropertyGroup>
<GodotSdkPackageVersionsFilePath>$(MSBuildThisFileDirectory)\SdkPackageVersions.props</GodotSdkPackageVersionsFilePath>
</PropertyGroup>
<Import Project="$(GodotSdkPackageVersionsFilePath)" />
</Project>

View File

@@ -0,0 +1,26 @@
<Project>
<PropertyGroup>
<_HasNuGetPackage Condition=" '$(_HasNuGetPackage)' == '' And '$(PackageId)' != '' And '$(GeneratePackageOnBuild.ToLower())' == 'true' ">true</_HasNuGetPackage>
<_HasNuGetPackage Condition=" '$(_HasNuGetPackage)' == '' ">false</_HasNuGetPackage>
<_HasSymbolsNuGetPackage Condition=" '$(_HasSymbolsNuGetPackage)' == '' And '$(PackageId)' != '' And '$(IncludeSymbols.ToLower())' == 'true' And '$(SymbolPackageFormat)' == 'snupkg' ">true</_HasSymbolsNuGetPackage>
<_HasSymbolsNuGetPackage Condition=" '$(_HasSymbolsNuGetPackage)' == '' ">false</_HasSymbolsNuGetPackage>
</PropertyGroup>
<Target Name="CopyNupkgToSConsOutputDir" AfterTargets="Pack"
Condition=" '$(_HasNuGetPackage)' == 'true' ">
<PropertyGroup>
<GodotSourceRootPath>$(MSBuildThisFileDirectory)\..\..\</GodotSourceRootPath>
<GodotOutputDataDir>$(GodotSourceRootPath)\bin\GodotSharp\</GodotOutputDataDir>
</PropertyGroup>
<Copy SourceFiles="$(PackageOutputPath)$(PackageId).$(PackageVersion).nupkg" DestinationFolder="$(GodotOutputDataDir)Tools\nupkgs\" />
<Copy Condition=" '$(_HasSymbolsNuGetPackage)' == 'true' " SourceFiles="$(PackageOutputPath)$(PackageId).$(PackageVersion).snupkg" DestinationFolder="$(GodotOutputDataDir)Tools\nupkgs\" />
</Target>
<Target Name="PushNuGetPackagesToLocalSource" BeforeTargets="Pack"
Condition=" '$(_HasNuGetPackage)' == 'true' And '$(PushNuGetToLocalSource)' != '' ">
<Copy SourceFiles="$(PackageOutputPath)$(PackageId).$(PackageVersion).nupkg" DestinationFolder="$(PushNuGetToLocalSource)\" />
<Copy Condition=" '$(_HasSymbolsNuGetPackage)' == 'true' " SourceFiles="$(PackageOutputPath)$(PackageId).$(PackageVersion).snupkg" DestinationFolder="$(PushNuGetToLocalSource)\" />
</Target>
<Target Name="ClearNuGetLocalPackageCache" BeforeTargets="Pack"
Condition=" '$(_HasNuGetPackage)' == 'true' And '$(ClearNuGetLocalCache.ToLower())' == 'true' ">
<RemoveDir Directories="$(NugetPackageRoot)/$(PackageId.ToLower())/$(PackageVersion)" />
</Target>
</Project>

55
modules/mono/README.md Normal file
View File

@@ -0,0 +1,55 @@
# How to build and run
1. Build Godot with the module enabled: `module_mono_enabled=yes`.
2. After building Godot, use it to generate the C# glue code:
```sh
<godot_binary> --generate-mono-glue ./modules/mono/glue
```
3. Build the C# solutions:
```sh
./modules/mono/build_scripts/build_assemblies.py --godot-output-dir ./bin
```
The paths specified in these examples assume the command is being run from
the Godot source root.
# How to deal with NuGet packages
We distribute the API assemblies, our source generators, and our custom
MSBuild project SDK as NuGet packages. This is all transparent to the user,
but it can make things complicated during development.
In order to use Godot with a development of those packages, we must create
a local NuGet source where MSBuild can find them. This can be done with
the .NET CLI:
```sh
dotnet nuget add source ~/MyLocalNugetSource --name MyLocalNugetSource
```
The Godot NuGet packages must be added to that local source. Additionally,
we must make sure there are no other versions of the package in the NuGet
cache, as MSBuild may pick one of those instead.
In order to simplify this process, the `build_assemblies.py` script provides
the following `--push-nupkgs-local` option:
```sh
./modules/mono/build_scripts/build_assemblies.py --godot-output-dir ./bin \
--push-nupkgs-local ~/MyLocalNugetSource
```
This option ensures the packages will be added to the specified local NuGet
source and that conflicting versions of the package are removed from the
NuGet cache. It's recommended to always use this option when building the
C# solutions during development to avoid mistakes.
# Double Precision Support (REAL_T_IS_DOUBLE)
Follow the above instructions but build Godot with the precision=double argument to scons
When building the NuGet packages, specify `--precision=double` - for example:
```sh
./modules/mono/build_scripts/build_assemblies.py --godot-output-dir ./bin \
--push-nupkgs-local ~/MyLocalNugetSource --precision=double
```

24
modules/mono/SCsub Normal file
View File

@@ -0,0 +1,24 @@
#!/usr/bin/env python
from misc.utility.scons_hints import *
import build_scripts.mono_configure as mono_configure
Import("env")
Import("env_modules")
env_mono = env_modules.Clone()
# Configure Mono
mono_configure.configure(env, env_mono)
# Add sources
env_mono.add_source_files(env.modules_sources, "*.cpp")
env_mono.add_source_files(env.modules_sources, "glue/*.cpp")
env_mono.add_source_files(env.modules_sources, "mono_gd/*.cpp")
env_mono.add_source_files(env.modules_sources, "utils/*.cpp")
if env.editor_build:
env_mono.add_source_files(env.modules_sources, "editor/*.cpp")
SConscript("editor/script_templates/SCsub")

0
modules/mono/__init__.py Normal file
View File

View File

View File

@@ -0,0 +1,441 @@
#!/usr/bin/python3
import os
import os.path
import shlex
import subprocess
from dataclasses import dataclass
from typing import List, Optional
def find_dotnet_cli():
if os.name == "nt":
for hint_dir in os.environ["PATH"].split(os.pathsep):
hint_dir = hint_dir.strip('"')
hint_path = os.path.join(hint_dir, "dotnet")
if os.path.isfile(hint_path) and os.access(hint_path, os.X_OK):
return hint_path
if os.path.isfile(hint_path + ".exe") and os.access(hint_path + ".exe", os.X_OK):
return hint_path + ".exe"
else:
for hint_dir in os.environ["PATH"].split(os.pathsep):
hint_dir = hint_dir.strip('"')
hint_path = os.path.join(hint_dir, "dotnet")
if os.path.isfile(hint_path) and os.access(hint_path, os.X_OK):
return hint_path
def find_msbuild_standalone_windows():
msbuild_tools_path = find_msbuild_tools_path_reg()
if msbuild_tools_path:
return os.path.join(msbuild_tools_path, "MSBuild.exe")
return None
def find_msbuild_mono_windows(mono_prefix):
assert mono_prefix is not None
mono_bin_dir = os.path.join(mono_prefix, "bin")
msbuild_mono = os.path.join(mono_bin_dir, "msbuild.bat")
if os.path.isfile(msbuild_mono):
return msbuild_mono
return None
def find_msbuild_mono_unix():
import sys
hint_dirs = []
if sys.platform == "darwin":
hint_dirs[:0] = [
"/Library/Frameworks/Mono.framework/Versions/Current/bin",
"/usr/local/var/homebrew/linked/mono/bin",
]
for hint_dir in hint_dirs:
hint_path = os.path.join(hint_dir, "msbuild")
if os.path.isfile(hint_path):
return hint_path
elif os.path.isfile(hint_path + ".exe"):
return hint_path + ".exe"
for hint_dir in os.environ["PATH"].split(os.pathsep):
hint_dir = hint_dir.strip('"')
hint_path = os.path.join(hint_dir, "msbuild")
if os.path.isfile(hint_path) and os.access(hint_path, os.X_OK):
return hint_path
if os.path.isfile(hint_path + ".exe") and os.access(hint_path + ".exe", os.X_OK):
return hint_path + ".exe"
return None
def find_msbuild_tools_path_reg():
import subprocess
program_files = os.getenv("PROGRAMFILES(X86)")
if not program_files:
program_files = os.getenv("PROGRAMFILES")
vswhere = os.path.join(program_files, "Microsoft Visual Studio", "Installer", "vswhere.exe")
vswhere_args = ["-latest", "-products", "*", "-requires", "Microsoft.Component.MSBuild"]
try:
lines = subprocess.check_output([vswhere] + vswhere_args).splitlines()
for line in lines:
parts = line.decode("utf-8").split(":", 1)
if len(parts) < 2 or parts[0] != "installationPath":
continue
val = parts[1].strip()
if not val:
raise ValueError("Value of `installationPath` entry is empty")
# Since VS2019, the directory is simply named "Current"
msbuild_dir = os.path.join(val, "MSBuild", "Current", "Bin")
if os.path.isdir(msbuild_dir):
return msbuild_dir
# Directory name "15.0" is used in VS 2017
return os.path.join(val, "MSBuild", "15.0", "Bin")
raise ValueError("Cannot find `installationPath` entry")
except ValueError as e:
print("Error reading output from vswhere: " + str(e))
except OSError:
pass # Fine, vswhere not found
except (subprocess.CalledProcessError, OSError):
pass
@dataclass
class ToolsLocation:
dotnet_cli: str = ""
msbuild_standalone: str = ""
msbuild_mono: str = ""
mono_bin_dir: str = ""
def find_any_msbuild_tool(mono_prefix):
# Preference order: dotnet CLI > Standalone MSBuild > Mono's MSBuild
# Find dotnet CLI
dotnet_cli = find_dotnet_cli()
if dotnet_cli:
return ToolsLocation(dotnet_cli=dotnet_cli)
# Find standalone MSBuild
if os.name == "nt":
msbuild_standalone = find_msbuild_standalone_windows()
if msbuild_standalone:
return ToolsLocation(msbuild_standalone=msbuild_standalone)
if mono_prefix:
# Find Mono's MSBuild
if os.name == "nt":
msbuild_mono = find_msbuild_mono_windows(mono_prefix)
if msbuild_mono:
return ToolsLocation(msbuild_mono=msbuild_mono)
else:
msbuild_mono = find_msbuild_mono_unix()
if msbuild_mono:
return ToolsLocation(msbuild_mono=msbuild_mono)
return None
def run_msbuild(tools: ToolsLocation, sln: str, chdir_to: str, msbuild_args: Optional[List[str]] = None):
using_msbuild_mono = False
# Preference order: dotnet CLI > Standalone MSBuild > Mono's MSBuild
if tools.dotnet_cli:
args = [tools.dotnet_cli, "msbuild"]
elif tools.msbuild_standalone:
args = [tools.msbuild_standalone]
elif tools.msbuild_mono:
args = [tools.msbuild_mono]
using_msbuild_mono = True
else:
raise RuntimeError("Path to MSBuild or dotnet CLI not provided.")
args += [sln]
if msbuild_args:
args += msbuild_args
print("Running MSBuild: ", " ".join(shlex.quote(arg) for arg in args), flush=True)
msbuild_env = os.environ.copy()
# Needed when running from Developer Command Prompt for VS
if "PLATFORM" in msbuild_env:
del msbuild_env["PLATFORM"]
if using_msbuild_mono:
# The (Csc/Vbc/Fsc)ToolExe environment variables are required when
# building with Mono's MSBuild. They must point to the batch files
# in Mono's bin directory to make sure they are executed with Mono.
msbuild_env.update(
{
"CscToolExe": os.path.join(tools.mono_bin_dir, "csc.bat"),
"VbcToolExe": os.path.join(tools.mono_bin_dir, "vbc.bat"),
"FscToolExe": os.path.join(tools.mono_bin_dir, "fsharpc.bat"),
}
)
# We want to control cwd when running msbuild, because that's where the search for global.json begins.
return subprocess.call(args, env=msbuild_env, cwd=chdir_to)
def build_godot_api(msbuild_tool, module_dir, output_dir, push_nupkgs_local, precision, no_deprecated, werror):
target_filenames = [
"GodotSharp.dll",
"GodotSharp.pdb",
"GodotSharp.xml",
"GodotSharpEditor.dll",
"GodotSharpEditor.pdb",
"GodotSharpEditor.xml",
"GodotPlugins.dll",
"GodotPlugins.pdb",
"GodotPlugins.runtimeconfig.json",
]
for build_config in ["Debug", "Release"]:
editor_api_dir = os.path.join(output_dir, "GodotSharp", "Api", build_config)
targets = [os.path.join(editor_api_dir, filename) for filename in target_filenames]
args = ["/restore", "/t:Build", "/p:Configuration=" + build_config, "/p:NoWarn=1591"]
if push_nupkgs_local:
args += ["/p:ClearNuGetLocalCache=true", "/p:PushNuGetToLocalSource=" + push_nupkgs_local]
if precision == "double":
args += ["/p:GodotFloat64=true"]
if no_deprecated:
args += ["/p:GodotNoDeprecated=true"]
if werror:
args += ["/p:TreatWarningsAsErrors=true"]
sln = os.path.join(module_dir, "glue/GodotSharp/GodotSharp.sln")
exit_code = run_msbuild(msbuild_tool, sln=sln, chdir_to=module_dir, msbuild_args=args)
if exit_code != 0:
return exit_code
# Copy targets
core_src_dir = os.path.abspath(os.path.join(sln, os.pardir, "GodotSharp", "bin", build_config))
editor_src_dir = os.path.abspath(os.path.join(sln, os.pardir, "GodotSharpEditor", "bin", build_config))
plugins_src_dir = os.path.abspath(os.path.join(sln, os.pardir, "GodotPlugins", "bin", build_config, "net8.0"))
if not os.path.isdir(editor_api_dir):
assert not os.path.isfile(editor_api_dir)
os.makedirs(editor_api_dir)
def copy_target(target_path):
from shutil import copy
filename = os.path.basename(target_path)
src_path = os.path.join(core_src_dir, filename)
if not os.path.isfile(src_path):
src_path = os.path.join(editor_src_dir, filename)
if not os.path.isfile(src_path):
src_path = os.path.join(plugins_src_dir, filename)
print(f"Copying assembly to {target_path}...")
copy(src_path, target_path)
for scons_target in targets:
copy_target(scons_target)
return 0
def generate_sdk_package_versions():
# I can't believe importing files in Python is so convoluted when not
# following the golden standard for packages/modules.
import os
import sys
from os.path import dirname
# We want ../../../methods.py.
script_path = dirname(os.path.abspath(__file__))
root_path = dirname(dirname(dirname(script_path)))
sys.path.insert(0, root_path)
from methods import get_version_info
version_info = get_version_info("")
sys.path.remove(root_path)
version_str = "{major}.{minor}.{patch}".format(**version_info)
version_status = version_info["status"]
if version_status != "stable": # Pre-release
# If version was overridden to be e.g. "beta3", we insert a dot between
# "beta" and "3" to follow SemVer 2.0.
import re
match = re.search(r"[\d]+$", version_status)
if match:
pos = match.start()
version_status = version_status[:pos] + "." + version_status[pos:]
version_str += "-" + version_status
import version
version_defines = (
[
f"GODOT{version.major}",
f"GODOT{version.major}_{version.minor}",
f"GODOT{version.major}_{version.minor}_{version.patch}",
]
+ [f"GODOT{v}_OR_GREATER" for v in range(4, version.major + 1)]
+ [f"GODOT{version.major}_{v}_OR_GREATER" for v in range(0, version.minor + 1)]
+ [f"GODOT{version.major}_{version.minor}_{v}_OR_GREATER" for v in range(0, version.patch + 1)]
)
props = """<Project>
<PropertyGroup>
<PackageVersion_GodotSharp>{0}</PackageVersion_GodotSharp>
<PackageVersion_Godot_NET_Sdk>{0}</PackageVersion_Godot_NET_Sdk>
<PackageVersion_Godot_SourceGenerators>{0}</PackageVersion_Godot_SourceGenerators>
<GodotVersionConstants>{1}</GodotVersionConstants>
</PropertyGroup>
</Project>
""".format(version_str, ";".join(version_defines))
# We write in ../SdkPackageVersions.props.
with open(os.path.join(dirname(script_path), "SdkPackageVersions.props"), "w", encoding="utf-8", newline="\n") as f:
f.write(props)
# Also write the versioned docs URL to a constant for the Source Generators.
constants = """namespace Godot.SourceGenerators
{{
// TODO: This is currently disabled because of https://github.com/dotnet/roslyn/issues/52904
#pragma warning disable IDE0040 // Add accessibility modifiers.
partial class Common
{{
public const string VersionDocsUrl = "https://docs.godotengine.org/en/{docs_branch}";
}}
}}
""".format(**version_info)
generators_dir = os.path.join(
dirname(script_path),
"editor",
"Godot.NET.Sdk",
"Godot.SourceGenerators",
"Generated",
)
os.makedirs(generators_dir, exist_ok=True)
with open(os.path.join(generators_dir, "Common.Constants.cs"), "w", encoding="utf-8", newline="\n") as f:
f.write(constants)
def build_all(
msbuild_tool, module_dir, output_dir, godot_platform, dev_debug, push_nupkgs_local, precision, no_deprecated, werror
):
# Generate SdkPackageVersions.props and VersionDocsUrl constant
generate_sdk_package_versions()
# Godot API
exit_code = build_godot_api(
msbuild_tool, module_dir, output_dir, push_nupkgs_local, precision, no_deprecated, werror
)
if exit_code != 0:
return exit_code
# GodotTools
sln = os.path.join(module_dir, "editor/GodotTools/GodotTools.sln")
args = ["/restore", "/t:Build", "/p:Configuration=" + ("Debug" if dev_debug else "Release")] + (
["/p:GodotPlatform=" + godot_platform] if godot_platform else []
)
if push_nupkgs_local:
args += ["/p:ClearNuGetLocalCache=true", "/p:PushNuGetToLocalSource=" + push_nupkgs_local]
if precision == "double":
args += ["/p:GodotFloat64=true"]
exit_code = run_msbuild(msbuild_tool, sln=sln, chdir_to=module_dir, msbuild_args=args)
if exit_code != 0:
return exit_code
# Godot.NET.Sdk
args = ["/restore", "/t:Build", "/p:Configuration=Release"]
if push_nupkgs_local:
args += ["/p:ClearNuGetLocalCache=true", "/p:PushNuGetToLocalSource=" + push_nupkgs_local]
if precision == "double":
args += ["/p:GodotFloat64=true"]
if no_deprecated:
args += ["/p:GodotNoDeprecated=true"]
sln = os.path.join(module_dir, "editor/Godot.NET.Sdk/Godot.NET.Sdk.sln")
exit_code = run_msbuild(msbuild_tool, sln=sln, chdir_to=module_dir, msbuild_args=args)
if exit_code != 0:
return exit_code
return 0
def main():
import argparse
import sys
parser = argparse.ArgumentParser(description="Builds all Godot .NET solutions")
parser.add_argument("--godot-output-dir", type=str, required=True)
parser.add_argument(
"--dev-debug",
action="store_true",
default=False,
help="Build GodotTools and Godot.NET.Sdk with 'Configuration=Debug'",
)
parser.add_argument("--godot-platform", type=str, default="")
parser.add_argument("--mono-prefix", type=str, default="")
parser.add_argument("--push-nupkgs-local", type=str, default="")
parser.add_argument(
"--precision", type=str, default="single", choices=["single", "double"], help="Floating-point precision level"
)
parser.add_argument(
"--no-deprecated",
action="store_true",
default=False,
help="Build GodotSharp without using deprecated features. This is required, if the engine was built with 'deprecated=no'.",
)
parser.add_argument("--werror", action="store_true", default=False, help="Treat compiler warnings as errors.")
args = parser.parse_args()
this_script_dir = os.path.dirname(os.path.realpath(__file__))
module_dir = os.path.abspath(os.path.join(this_script_dir, os.pardir))
output_dir = os.path.abspath(args.godot_output_dir)
push_nupkgs_local = os.path.abspath(args.push_nupkgs_local) if args.push_nupkgs_local else None
msbuild_tool = find_any_msbuild_tool(args.mono_prefix)
if msbuild_tool is None:
print("Unable to find MSBuild")
sys.exit(1)
exit_code = build_all(
msbuild_tool,
module_dir,
output_dir,
args.godot_platform,
args.dev_debug,
push_nupkgs_local,
args.precision,
args.no_deprecated,
args.werror,
)
sys.exit(exit_code)
if __name__ == "__main__":
main()

View File

@@ -0,0 +1,22 @@
def is_desktop(platform):
return platform in ["windows", "macos", "linuxbsd"]
def is_unix_like(platform):
return platform in ["macos", "linuxbsd", "android", "ios"]
def module_supports_tools_on(platform):
return is_desktop(platform)
def configure(env, env_mono):
# is_android = env["platform"] == "android"
# is_web = env["platform"] == "web"
# is_ios = env["platform"] == "ios"
# is_ios_sim = is_ios and env["arch"] in ["x86_32", "x86_64"]
if env.editor_build:
if not module_supports_tools_on(env["platform"]):
raise RuntimeError("This module does not currently support building for this platform for editor builds.")
env_mono.Append(CPPDEFINES=["GD_MONO_HOT_RELOAD"])

View File

@@ -0,0 +1,235 @@
/**************************************************************************/
/* class_db_api_json.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/**************************************************************************/
/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */
/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#include "class_db_api_json.h"
#ifdef DEBUG_ENABLED
#include "core/config/project_settings.h"
#include "core/io/file_access.h"
#include "core/io/json.h"
#include "core/version.h"
void class_db_api_to_json(const String &p_output_file, ClassDB::APIType p_api) {
Dictionary classes_dict;
List<StringName> class_list;
ClassDB::get_class_list(&class_list);
// Must be alphabetically sorted for hash to compute.
class_list.sort_custom<StringName::AlphCompare>();
for (const StringName &E : class_list) {
ClassDB::ClassInfo *t = ClassDB::classes.getptr(E);
ERR_FAIL_NULL(t);
if (t->api != p_api || !t->exposed) {
continue;
}
Dictionary class_dict;
classes_dict[t->name] = class_dict;
class_dict["inherits"] = t->inherits;
{ //methods
List<StringName> snames;
for (const KeyValue<StringName, MethodBind *> &F : t->method_map) {
String name = F.key.operator String();
ERR_CONTINUE(name.is_empty());
if (name[0] == '_') {
continue; // Ignore non-virtual methods that start with an underscore
}
snames.push_back(F.key);
}
snames.sort_custom<StringName::AlphCompare>();
Array methods;
for (const StringName &F : snames) {
Dictionary method_dict;
methods.push_back(method_dict);
MethodBind *mb = t->method_map[F];
method_dict["name"] = mb->get_name();
method_dict["argument_count"] = mb->get_argument_count();
method_dict["return_type"] = mb->get_argument_type(-1);
Array arguments;
method_dict["arguments"] = arguments;
for (int i = 0; i < mb->get_argument_count(); i++) {
Dictionary argument_dict;
arguments.push_back(argument_dict);
const PropertyInfo info = mb->get_argument_info(i);
argument_dict["type"] = info.type;
argument_dict["name"] = info.name;
argument_dict["hint"] = info.hint;
argument_dict["hint_string"] = info.hint_string;
}
method_dict["default_argument_count"] = mb->get_default_argument_count();
Array default_arguments;
method_dict["default_arguments"] = default_arguments;
for (int i = 0; i < mb->get_default_argument_count(); i++) {
Dictionary default_argument_dict;
default_arguments.push_back(default_argument_dict);
//hash should not change, i hope for tis
Variant da = mb->get_default_argument(i);
default_argument_dict["value"] = da;
}
method_dict["hint_flags"] = mb->get_hint_flags();
}
if (!methods.is_empty()) {
class_dict["methods"] = methods;
}
}
{ //constants
List<StringName> snames;
for (const KeyValue<StringName, int64_t> &F : t->constant_map) {
snames.push_back(F.key);
}
snames.sort_custom<StringName::AlphCompare>();
Array constants;
for (const StringName &F : snames) {
Dictionary constant_dict;
constants.push_back(constant_dict);
constant_dict["name"] = F;
constant_dict["value"] = t->constant_map[F];
}
if (!constants.is_empty()) {
class_dict["constants"] = constants;
}
}
{ //signals
List<StringName> snames;
for (const KeyValue<StringName, MethodInfo> &F : t->signal_map) {
snames.push_back(F.key);
}
snames.sort_custom<StringName::AlphCompare>();
Array signals;
for (const StringName &F : snames) {
Dictionary signal_dict;
signals.push_back(signal_dict);
MethodInfo &mi = t->signal_map[F];
signal_dict["name"] = F;
Array arguments;
signal_dict["arguments"] = arguments;
for (const PropertyInfo &pi : mi.arguments) {
Dictionary argument_dict;
arguments.push_back(argument_dict);
argument_dict["type"] = pi.type;
}
}
if (!signals.is_empty()) {
class_dict["signals"] = signals;
}
}
{ //properties
List<StringName> snames;
for (const KeyValue<StringName, ClassDB::PropertySetGet> &F : t->property_setget) {
snames.push_back(F.key);
}
snames.sort_custom<StringName::AlphCompare>();
Array properties;
for (const StringName &F : snames) {
Dictionary property_dict;
properties.push_back(property_dict);
ClassDB::PropertySetGet *psg = t->property_setget.getptr(F);
property_dict["name"] = F;
property_dict["setter"] = psg->setter;
property_dict["getter"] = psg->getter;
}
if (!properties.is_empty()) {
class_dict["property_setget"] = properties;
}
}
Array property_list;
//property list
for (const PropertyInfo &F : t->property_list) {
Dictionary property_dict;
property_list.push_back(property_dict);
property_dict["name"] = F.name;
property_dict["type"] = F.type;
property_dict["hint"] = F.hint;
property_dict["hint_string"] = F.hint_string;
property_dict["usage"] = F.usage;
}
if (!property_list.is_empty()) {
class_dict["property_list"] = property_list;
}
}
Ref<FileAccess> f = FileAccess::open(p_output_file, FileAccess::WRITE);
ERR_FAIL_COND_MSG(f.is_null(), "Cannot open file '" + p_output_file + "'.");
f->store_string(JSON::stringify(classes_dict, "\t"));
print_line(String() + "ClassDB API JSON written to: " + ProjectSettings::get_singleton()->globalize_path(p_output_file));
}
#endif // DEBUG_ENABLED

View File

@@ -0,0 +1,39 @@
/**************************************************************************/
/* class_db_api_json.h */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/**************************************************************************/
/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */
/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#ifdef DEBUG_ENABLED
#include "core/object/class_db.h"
void class_db_api_to_json(const String &p_output_file, ClassDB::APIType p_api);
#endif // DEBUG_ENABLED

36
modules/mono/config.py Normal file
View File

@@ -0,0 +1,36 @@
def can_build(env, platform):
if env["arch"].startswith("rv"):
return False
if env.editor_build:
env.module_add_dependencies("mono", ["regex"])
return True
def configure(env):
# Check if the platform has marked mono as supported.
supported = env.get("supported", [])
if "mono" not in supported:
import sys
print("The 'mono' module does not currently support building for this platform. Aborting.")
sys.exit(255)
env.add_module_version_string("mono")
def get_doc_classes():
return [
"CSharpScript",
"GodotSharp",
]
def get_doc_path():
return "doc_classes"
def is_enabled():
# The module is disabled by default. Use module_mono_enabled=yes to enable it.
return False

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,604 @@
/**************************************************************************/
/* csharp_script.h */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/**************************************************************************/
/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */
/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "mono_gc_handle.h"
#include "mono_gd/gd_mono.h"
#include "core/doc_data.h"
#include "core/io/resource_loader.h"
#include "core/io/resource_saver.h"
#include "core/object/script_language.h"
#include "core/templates/self_list.h"
#ifdef TOOLS_ENABLED
#include "editor/plugins/editor_plugin.h"
#endif
class CSharpScript;
class CSharpInstance;
class CSharpLanguage;
template <typename TScriptInstance, typename TScriptLanguage>
TScriptInstance *cast_script_instance(ScriptInstance *p_inst) {
return dynamic_cast<TScriptInstance *>(p_inst);
}
#define CAST_CSHARP_INSTANCE(m_inst) (cast_script_instance<CSharpInstance, CSharpLanguage>(m_inst))
class CSharpScript : public Script {
GDCLASS(CSharpScript, Script);
friend class CSharpInstance;
friend class CSharpLanguage;
public:
struct TypeInfo {
/**
* Name of the C# class.
*/
String class_name;
/**
* Name of the native class this script derives from.
*/
StringName native_base_name;
/**
* Path to the icon that will be used for this class by the editor.
*/
String icon_path;
/**
* Script is marked as tool and runs in the editor.
*/
bool is_tool = false;
/**
* Script is marked as global class and will be registered in the editor.
* Registered classes can be created using certain editor dialogs and
* can be referenced by name from other languages that support the feature.
*/
bool is_global_class = false;
/**
* Script is declared abstract.
*/
bool is_abstract = false;
/**
* The C# type that corresponds to this script is a constructed generic type.
* E.g.: `Dictionary<int, string>`
*/
bool is_constructed_generic_type = false;
/**
* The C# type that corresponds to this script is a generic type definition.
* E.g.: `Dictionary<,>`
*/
bool is_generic_type_definition = false;
/**
* The C# type that corresponds to this script contains generic type parameters,
* regardless of whether the type parameters are bound or not.
*/
bool is_generic() const {
return is_constructed_generic_type || is_generic_type_definition;
}
/**
* Check if the script can be instantiated.
* C# types can't be instantiated if they are abstract or contain generic
* type parameters, but a CSharpScript is still created for them.
*/
bool can_instantiate() const {
return !is_abstract && !is_generic_type_definition;
}
};
private:
/**
* Contains the C# type information for this script.
*/
TypeInfo type_info;
/**
* Scripts are valid when the corresponding C# class is found and used
* to extract the script info using the [update_script_class_info] method.
*/
bool valid = false;
/**
* Scripts extract info from the C# class in the reload methods but,
* if the reload is not invalidated, then the current extracted info
* is still valid and there's no need to reload again.
*/
bool reload_invalidated = false;
/**
* Base script that this script derives from, or null if it derives from a
* native Godot class.
*/
Ref<CSharpScript> base_script;
HashSet<Object *> instances;
#ifdef GD_MONO_HOT_RELOAD
struct StateBackup {
// TODO
// Replace with buffer containing the serialized state of managed scripts.
// Keep variant state backup to use only with script instance placeholders.
List<Pair<StringName, Variant>> properties;
Dictionary event_signals;
};
HashSet<ObjectID> pending_reload_instances;
RBMap<ObjectID, StateBackup> pending_reload_state;
bool was_tool_before_reload = false;
HashSet<ObjectID> pending_replace_placeholders;
#endif
/**
* Script source code.
*/
String source;
SelfList<CSharpScript> script_list = this;
Dictionary rpc_config;
struct EventSignalInfo {
StringName name; // MethodInfo stores a string...
MethodInfo method_info;
};
struct CSharpMethodInfo {
StringName name; // MethodInfo stores a string...
MethodInfo method_info;
};
Vector<EventSignalInfo> event_signals;
Vector<CSharpMethodInfo> methods;
#ifdef TOOLS_ENABLED
List<PropertyInfo> exported_members_cache; // members_cache
HashMap<StringName, Variant> exported_members_defval_cache; // member_default_values_cache
HashSet<PlaceHolderScriptInstance *> placeholders;
bool source_changed_cache = false;
bool placeholder_fallback_enabled = false;
bool exports_invalidated = true;
void _update_exports_values(HashMap<StringName, Variant> &values, List<PropertyInfo> &propnames);
void _placeholder_erased(PlaceHolderScriptInstance *p_placeholder) override;
#endif
#if defined(TOOLS_ENABLED) || defined(DEBUG_ENABLED)
HashSet<StringName> exported_members_names;
#endif
HashMap<StringName, PropertyInfo> member_info;
void _clear();
static void GD_CLR_STDCALL _add_property_info_list_callback(CSharpScript *p_script, const String *p_current_class_name, void *p_props, int32_t p_count);
#ifdef TOOLS_ENABLED
static void GD_CLR_STDCALL _add_property_default_values_callback(CSharpScript *p_script, void *p_def_vals, int32_t p_count);
#endif
bool _update_exports(PlaceHolderScriptInstance *p_instance_to_update = nullptr);
CSharpInstance *_create_instance(const Variant **p_args, int p_argcount, Object *p_owner, bool p_is_ref_counted, Callable::CallError &r_error);
Variant _new(const Variant **p_args, int p_argcount, Callable::CallError &r_error);
// Do not use unless you know what you are doing
static void update_script_class_info(Ref<CSharpScript> p_script);
void _get_script_signal_list(List<MethodInfo> *r_signals, bool p_include_base) const;
protected:
static void _bind_methods();
bool _get(const StringName &p_name, Variant &r_ret) const;
bool _set(const StringName &p_name, const Variant &p_value);
void _get_property_list(List<PropertyInfo> *p_properties) const;
public:
static void reload_registered_script(Ref<CSharpScript> p_script);
bool can_instantiate() const override;
StringName get_instance_base_type() const override;
ScriptInstance *instance_create(Object *p_this) override;
PlaceHolderScriptInstance *placeholder_instance_create(Object *p_this) override;
bool instance_has(const Object *p_this) const override;
bool has_source_code() const override;
String get_source_code() const override;
void set_source_code(const String &p_code) override;
#ifdef TOOLS_ENABLED
virtual StringName get_doc_class_name() const override { return StringName(); } // TODO
virtual Vector<DocData::ClassDoc> get_documentation() const override {
// TODO
Vector<DocData::ClassDoc> docs;
return docs;
}
virtual String get_class_icon_path() const override {
return type_info.icon_path;
}
#endif // TOOLS_ENABLED
Error reload(bool p_keep_state = false) override;
bool has_script_signal(const StringName &p_signal) const override;
void get_script_signal_list(List<MethodInfo> *r_signals) const override;
bool get_property_default_value(const StringName &p_property, Variant &r_value) const override;
void get_script_property_list(List<PropertyInfo> *r_list) const override;
void update_exports() override;
void get_members(HashSet<StringName> *p_members) override;
bool is_tool() const override {
return type_info.is_tool;
}
bool is_valid() const override {
return valid;
}
bool is_abstract() const override {
return type_info.is_abstract;
}
bool inherits_script(const Ref<Script> &p_script) const override;
Ref<Script> get_base_script() const override;
StringName get_global_name() const override;
ScriptLanguage *get_language() const override;
void get_script_method_list(List<MethodInfo> *p_list) const override;
bool has_method(const StringName &p_method) const override;
virtual int get_script_method_argument_count(const StringName &p_method, bool *r_is_valid = nullptr) const override;
MethodInfo get_method_info(const StringName &p_method) const override;
Variant callp(const StringName &p_method, const Variant **p_args, int p_argcount, Callable::CallError &r_error) override;
int get_member_line(const StringName &p_member) const override;
const Variant get_rpc_config() const override;
#ifdef TOOLS_ENABLED
bool is_placeholder_fallback_enabled() const override {
return placeholder_fallback_enabled;
}
#endif
Error load_source_code(const String &p_path);
CSharpScript();
~CSharpScript();
};
class CSharpInstance : public ScriptInstance {
friend class CSharpScript;
friend class CSharpLanguage;
Object *owner = nullptr;
bool base_ref_counted = false;
bool ref_dying = false;
bool unsafe_referenced = false;
bool predelete_notified = false;
bool destructing_script_instance = false;
Ref<CSharpScript> script;
MonoGCHandleData gchandle;
List<Callable> connected_event_signals;
bool _reference_owner_unsafe();
/*
* If true is returned, the caller must memdelete the script instance's owner.
*/
bool _unreference_owner_unsafe();
/*
* If false is returned, the caller must destroy the script instance by removing it from its owner.
*/
bool _internal_new_managed();
// Do not use unless you know what you are doing
static CSharpInstance *create_for_managed_type(Object *p_owner, CSharpScript *p_script, const MonoGCHandleData &p_gchandle);
public:
_FORCE_INLINE_ bool is_destructing_script_instance() { return destructing_script_instance; }
_FORCE_INLINE_ GCHandleIntPtr get_gchandle_intptr() { return gchandle.get_intptr(); }
Object *get_owner() override;
bool set(const StringName &p_name, const Variant &p_value) override;
bool get(const StringName &p_name, Variant &r_ret) const override;
void get_property_list(List<PropertyInfo> *p_properties) const override;
Variant::Type get_property_type(const StringName &p_name, bool *r_is_valid) const override;
virtual void validate_property(PropertyInfo &p_property) const override;
bool property_can_revert(const StringName &p_name) const override;
bool property_get_revert(const StringName &p_name, Variant &r_ret) const override;
void get_method_list(List<MethodInfo> *p_list) const override;
bool has_method(const StringName &p_method) const override;
virtual int get_method_argument_count(const StringName &p_method, bool *r_is_valid = nullptr) const override;
Variant callp(const StringName &p_method, const Variant **p_args, int p_argcount, Callable::CallError &r_error) override;
void mono_object_disposed(GCHandleIntPtr p_gchandle_to_free);
/*
* If 'r_delete_owner' is set to true, the caller must memdelete the script instance's owner. Otherwise, if
* 'r_remove_script_instance' is set to true, the caller must destroy the script instance by removing it from its owner.
*/
void mono_object_disposed_baseref(GCHandleIntPtr p_gchandle_to_free, bool p_is_finalizer, bool &r_delete_owner, bool &r_remove_script_instance);
void connect_event_signals();
void disconnect_event_signals();
void refcount_incremented() override;
bool refcount_decremented() override;
const Variant get_rpc_config() const override;
void notification(int p_notification, bool p_reversed = false) override;
void _call_notification(int p_notification, bool p_reversed = false);
String to_string(bool *r_valid) override;
Ref<Script> get_script() const override;
ScriptLanguage *get_language() override;
CSharpInstance(const Ref<CSharpScript> &p_script);
~CSharpInstance();
};
struct CSharpScriptBinding {
bool inited = false;
StringName type_name;
MonoGCHandleData gchandle;
Object *owner = nullptr;
CSharpScriptBinding() {}
};
class ManagedCallableMiddleman : public Object {
GDCLASS(ManagedCallableMiddleman, Object);
};
class CSharpLanguage : public ScriptLanguage {
friend class CSharpScript;
friend class CSharpInstance;
static CSharpLanguage *singleton;
bool finalizing = false;
bool finalized = false;
GDMono *gdmono = nullptr;
SelfList<CSharpScript>::List script_list;
Mutex script_instances_mutex;
Mutex script_gchandle_release_mutex;
Mutex language_bind_mutex;
RBMap<Object *, CSharpScriptBinding> script_bindings;
#ifdef DEBUG_ENABLED
// List of unsafe object references
HashMap<ObjectID, int> unsafe_object_references;
Mutex unsafe_object_references_lock;
#endif
ManagedCallableMiddleman *managed_callable_middleman = memnew(ManagedCallableMiddleman);
int lang_idx = -1;
// For debug_break and debug_break_parse
int _debug_parse_err_line = -1;
String _debug_parse_err_file;
String _debug_error;
friend class GDMono;
#ifdef TOOLS_ENABLED
EditorPlugin *godotsharp_editor = nullptr;
static void _editor_init_callback();
#endif
static void *_instance_binding_create_callback(void *p_token, void *p_instance);
static void _instance_binding_free_callback(void *p_token, void *p_instance, void *p_binding);
static GDExtensionBool _instance_binding_reference_callback(void *p_token, void *p_binding, GDExtensionBool p_reference);
static GDExtensionInstanceBindingCallbacks _instance_binding_callbacks;
public:
static void *get_instance_binding(Object *p_object);
static void *get_existing_instance_binding(Object *p_object);
static void *get_instance_binding_with_setup(Object *p_object);
static bool has_instance_binding(Object *p_object);
const Mutex &get_language_bind_mutex() {
return language_bind_mutex;
}
const Mutex &get_script_instances_mutex() {
return script_instances_mutex;
}
_FORCE_INLINE_ int get_language_index() {
return lang_idx;
}
void set_language_index(int p_idx);
_FORCE_INLINE_ static CSharpLanguage *get_singleton() {
return singleton;
}
#ifdef TOOLS_ENABLED
_FORCE_INLINE_ EditorPlugin *get_godotsharp_editor() const {
return godotsharp_editor;
}
#endif
static void release_script_gchandle(MonoGCHandleData &p_gchandle);
static void release_script_gchandle_thread_safe(GCHandleIntPtr p_gchandle_to_free, MonoGCHandleData &r_gchandle);
static void release_binding_gchandle_thread_safe(GCHandleIntPtr p_gchandle_to_free, CSharpScriptBinding &r_script_binding);
bool debug_break(const String &p_error, bool p_allow_continue = true);
bool debug_break_parse(const String &p_file, int p_line, const String &p_error);
#ifdef GD_MONO_HOT_RELOAD
bool is_assembly_reloading_needed();
void reload_assemblies(bool p_soft_reload);
#endif
_FORCE_INLINE_ ManagedCallableMiddleman *get_managed_callable_middleman() const {
return managed_callable_middleman;
}
String get_name() const override;
/* LANGUAGE FUNCTIONS */
String get_type() const override;
String get_extension() const override;
void init() override;
void finish() override;
void finalize();
/* EDITOR FUNCTIONS */
Vector<String> get_reserved_words() const override;
bool is_control_flow_keyword(const String &p_keyword) const override;
Vector<String> get_comment_delimiters() const override;
Vector<String> get_doc_comment_delimiters() const override;
Vector<String> get_string_delimiters() const override;
bool is_using_templates() override;
virtual Ref<Script> make_template(const String &p_template, const String &p_class_name, const String &p_base_class_name) const override;
virtual Vector<ScriptTemplate> get_built_in_templates(const StringName &p_object) override;
/* TODO */ bool validate(const String &p_script, const String &p_path, List<String> *r_functions,
List<ScriptLanguage::ScriptError> *r_errors = nullptr, List<ScriptLanguage::Warning> *r_warnings = nullptr, HashSet<int> *r_safe_lines = nullptr) const override {
return true;
}
String validate_path(const String &p_path) const override;
Script *create_script() const override;
#ifndef DISABLE_DEPRECATED
virtual bool has_named_classes() const override { return false; }
#endif
bool supports_builtin_mode() const override;
/* TODO? */ int find_function(const String &p_function, const String &p_code) const override {
return -1;
}
String make_function(const String &p_class, const String &p_name, const PackedStringArray &p_args) const override;
virtual bool can_make_function() const override { return false; }
virtual String _get_indentation() const;
/* TODO? */ void auto_indent_code(String &p_code, int p_from_line, int p_to_line) const override {}
/* TODO */ void add_global_constant(const StringName &p_variable, const Variant &p_value) override {}
virtual ScriptNameCasing preferred_file_name_casing() const override;
/* SCRIPT GLOBAL CLASS FUNCTIONS */
virtual bool handles_global_class_type(const String &p_type) const override;
virtual String get_global_class_name(const String &p_path, String *r_base_type = nullptr, String *r_icon_path = nullptr, bool *r_is_abstract = nullptr, bool *r_is_tool = nullptr) const override;
/* DEBUGGER FUNCTIONS */
String debug_get_error() const override;
int debug_get_stack_level_count() const override;
int debug_get_stack_level_line(int p_level) const override;
String debug_get_stack_level_function(int p_level) const override;
String debug_get_stack_level_source(int p_level) const override;
/* TODO */ void debug_get_stack_level_locals(int p_level, List<String> *p_locals, List<Variant> *p_values, int p_max_subitems, int p_max_depth) override {}
/* TODO */ void debug_get_stack_level_members(int p_level, List<String> *p_members, List<Variant> *p_values, int p_max_subitems, int p_max_depth) override {}
/* TODO */ void debug_get_globals(List<String> *p_locals, List<Variant> *p_values, int p_max_subitems, int p_max_depth) override {}
/* TODO */ String debug_parse_stack_level_expression(int p_level, const String &p_expression, int p_max_subitems, int p_max_depth) override {
return "";
}
Vector<StackInfo> debug_get_current_stack_info() override;
/* PROFILING FUNCTIONS */
/* TODO */ void profiling_start() override {}
/* TODO */ void profiling_stop() override {}
/* TODO */ void profiling_set_save_native_calls(bool p_enable) override {}
/* TODO */ int profiling_get_accumulated_data(ProfilingInfo *p_info_arr, int p_info_max) override {
return 0;
}
/* TODO */ int profiling_get_frame_data(ProfilingInfo *p_info_arr, int p_info_max) override {
return 0;
}
void frame() override;
/* TODO? */ void get_public_functions(List<MethodInfo> *p_functions) const override {}
/* TODO? */ void get_public_constants(List<Pair<String, Variant>> *p_constants) const override {}
/* TODO? */ void get_public_annotations(List<MethodInfo> *p_annotations) const override {}
void reload_all_scripts() override;
void reload_scripts(const Array &p_scripts, bool p_soft_reload) override;
void reload_tool_script(const Ref<Script> &p_script, bool p_soft_reload) override;
/* LOADER FUNCTIONS */
void get_recognized_extensions(List<String> *p_extensions) const override;
#ifdef TOOLS_ENABLED
Error open_in_external_editor(const Ref<Script> &p_script, int p_line, int p_col) override;
bool overrides_external_editor() override;
#endif
RBMap<Object *, CSharpScriptBinding>::Element *insert_script_binding(Object *p_object, const CSharpScriptBinding &p_script_binding);
bool setup_csharp_script_binding(CSharpScriptBinding &r_script_binding, Object *p_object);
static void tie_native_managed_to_unmanaged(GCHandleIntPtr p_gchandle_intptr, Object *p_unmanaged, const StringName *p_native_name, bool p_ref_counted);
static void tie_user_managed_to_unmanaged(GCHandleIntPtr p_gchandle_intptr, Object *p_unmanaged, Ref<CSharpScript> *p_script, bool p_ref_counted);
static void tie_managed_to_unmanaged_with_pre_setup(GCHandleIntPtr p_gchandle_intptr, Object *p_unmanaged);
void post_unsafe_reference(Object *p_obj);
void pre_unsafe_unreference(Object *p_obj);
CSharpLanguage();
~CSharpLanguage();
};
class ResourceFormatLoaderCSharpScript : public ResourceFormatLoader {
public:
Ref<Resource> load(const String &p_path, const String &p_original_path = "", Error *r_error = nullptr, bool p_use_sub_threads = false, float *r_progress = nullptr, CacheMode p_cache_mode = CACHE_MODE_REUSE) override;
void get_recognized_extensions(List<String> *p_extensions) const override;
bool handles_type(const String &p_type) const override;
String get_resource_type(const String &p_path) const override;
};
class ResourceFormatSaverCSharpScript : public ResourceFormatSaver {
public:
Error save(const Ref<Resource> &p_resource, const String &p_path, uint32_t p_flags = 0) override;
void get_recognized_extensions(const Ref<Resource> &p_resource, List<String> *p_extensions) const override;
bool recognize(const Ref<Resource> &p_resource) const override;
};

View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="CSharpScript" inherits="Script" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
A script implemented in the C# programming language, saved with the [code].cs[/code] extension (Mono-enabled builds only).
</brief_description>
<description>
This class represents a C# script. It is the C# equivalent of the [GDScript] class and is only available in Mono-enabled Godot builds.
</description>
<tutorials>
<link title="C# documentation index">$DOCS_URL/tutorials/scripting/c_sharp/index.html</link>
</tutorials>
<methods>
<method name="new" qualifiers="vararg">
<return type="Variant" />
<description>
Returns a new instance of the script.
</description>
</method>
</methods>
</class>

View File

@@ -0,0 +1,2 @@
# Generated sources directories
Godot.SourceGenerators/Generated

View File

@@ -0,0 +1,49 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.9.34728.123
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Godot.NET.Sdk", "Godot.NET.Sdk\Godot.NET.Sdk.csproj", "{31B00BFA-DEA1-42FA-A472-9E54A92A8A5F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Godot.SourceGenerators", "Godot.SourceGenerators\Godot.SourceGenerators.csproj", "{32D31B23-2A45-4099-B4F5-95B4C8FF7D9F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Godot.SourceGenerators.Sample", "Godot.SourceGenerators.Sample\Godot.SourceGenerators.Sample.csproj", "{7297A614-8DF5-43DE-9EAD-99671B26BD1F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Godot.SourceGenerators.Tests", "Godot.SourceGenerators.Tests\Godot.SourceGenerators.Tests.csproj", "{07E6D201-35C9-4463-9B29-D16621EA733D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GodotSharp", "..\..\glue\GodotSharp\GodotSharp\GodotSharp.csproj", "{AEBF0036-DA76-4341-B651-A3F2856AB2FA}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{31B00BFA-DEA1-42FA-A472-9E54A92A8A5F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{31B00BFA-DEA1-42FA-A472-9E54A92A8A5F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{31B00BFA-DEA1-42FA-A472-9E54A92A8A5F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{31B00BFA-DEA1-42FA-A472-9E54A92A8A5F}.Release|Any CPU.Build.0 = Release|Any CPU
{32D31B23-2A45-4099-B4F5-95B4C8FF7D9F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{32D31B23-2A45-4099-B4F5-95B4C8FF7D9F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{32D31B23-2A45-4099-B4F5-95B4C8FF7D9F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{32D31B23-2A45-4099-B4F5-95B4C8FF7D9F}.Release|Any CPU.Build.0 = Release|Any CPU
{7297A614-8DF5-43DE-9EAD-99671B26BD1F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7297A614-8DF5-43DE-9EAD-99671B26BD1F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7297A614-8DF5-43DE-9EAD-99671B26BD1F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7297A614-8DF5-43DE-9EAD-99671B26BD1F}.Release|Any CPU.Build.0 = Release|Any CPU
{07E6D201-35C9-4463-9B29-D16621EA733D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{07E6D201-35C9-4463-9B29-D16621EA733D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{07E6D201-35C9-4463-9B29-D16621EA733D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{07E6D201-35C9-4463-9B29-D16621EA733D}.Release|Any CPU.Build.0 = Release|Any CPU
{AEBF0036-DA76-4341-B651-A3F2856AB2FA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AEBF0036-DA76-4341-B651-A3F2856AB2FA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AEBF0036-DA76-4341-B651-A3F2856AB2FA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AEBF0036-DA76-4341-B651-A3F2856AB2FA}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {49831022-16BD-41E0-A5F3-EDE1279F4176}
EndGlobalSection
EndGlobal

View File

@@ -0,0 +1,37 @@
<Project Sdk="Microsoft.Build.NoTargets/2.0.1">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<Description>MSBuild .NET Sdk for Godot projects.</Description>
<Authors>Godot Engine contributors</Authors>
<PackageId>Godot.NET.Sdk</PackageId>
<Version>4.5.0</Version>
<PackageVersion>$(PackageVersion_Godot_NET_Sdk)</PackageVersion>
<RepositoryUrl>https://github.com/godotengine/godot/tree/master/modules/mono/editor/Godot.NET.Sdk</RepositoryUrl>
<PackageProjectUrl>$(RepositoryUrl)</PackageProjectUrl>
<PackageType>MSBuildSdk</PackageType>
<PackageTags>MSBuildSdk</PackageTags>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<Copyright>Copyright (c) Godot Engine contributors</Copyright>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<!-- Exclude target framework from the package dependencies as we don't include the build output -->
<SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking>
<IncludeBuildOutput>false</IncludeBuildOutput>
</PropertyGroup>
<ItemGroup>
<!-- Package Sdk\Sdk.props and Sdk\Sdk.targets file -->
<None Include="Sdk\Sdk.props" Pack="true" PackagePath="Sdk" />
<None Include="Sdk\Sdk.targets" Pack="true" PackagePath="Sdk" />
<!-- SdkPackageVersions.props -->
<None Include="$(GodotSdkPackageVersionsFilePath)" Pack="true" PackagePath="Sdk">
<Link>Sdk\SdkPackageVersions.props</Link>
</None>
<None Include="Sdk\Android.props" Pack="true" PackagePath="Sdk" />
<None Include="Sdk\iOSNativeAOT.props" Pack="true" PackagePath="Sdk" />
<None Include="Sdk\iOSNativeAOT.targets" Pack="true" PackagePath="Sdk" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,5 @@
<Project>
<PropertyGroup>
<UseMonoRuntime Condition=" '$(UseMonoRuntime)' == '' and '$(PublishAot)' != 'true' ">true</UseMonoRuntime>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1,108 @@
<Project>
<Import Project="$(MSBuildThisFileDirectory)\SdkPackageVersions.props" />
<PropertyGroup>
<UsingGodotNETSdk>true</UsingGodotNETSdk>
<!-- Determines if we should import Microsoft.NET.Sdk, if it wasn't already imported. -->
<GodotSdkImportsMicrosoftNetSdk Condition=" '$(UsingMicrosoftNETSdk)' != 'true' ">true</GodotSdkImportsMicrosoftNetSdk>
</PropertyGroup>
<PropertyGroup>
<Configurations>Debug;ExportDebug;ExportRelease</Configurations>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<GodotProjectDir Condition=" '$(GodotProjectDir)' == '' ">$(MSBuildProjectDirectory)</GodotProjectDir>
<GodotProjectDir>$([MSBuild]::EnsureTrailingSlash('$(GodotProjectDir)'))</GodotProjectDir>
<GodotProjectDirBase64 Condition=" $([MSBuild]::VersionGreaterThanOrEquals($(MSBuildAssemblyVersion), '17.3')) ">$([MSBuild]::ConvertToBase64('$(GodotProjectDir)'))</GodotProjectDirBase64>
<!-- Custom output paths for Godot projects. In brief, 'bin\' and 'obj\' are moved to '$(GodotProjectDir)\.godot\mono\temp\'. -->
<BaseOutputPath>$(GodotProjectDir).godot\mono\temp\bin\</BaseOutputPath>
<OutputPath>$(GodotProjectDir).godot\mono\temp\bin\$(Configuration)\</OutputPath>
<!--
Use custom IntermediateOutputPath and BaseIntermediateOutputPath only if it wasn't already set.
Otherwise the old values may have already been changed by MSBuild which can cause problems with NuGet.
-->
<IntermediateOutputPath Condition=" '$(IntermediateOutputPath)' == '' ">$(GodotProjectDir).godot\mono\temp\obj\$(Configuration)\</IntermediateOutputPath>
<BaseIntermediateOutputPath Condition=" '$(BaseIntermediateOutputPath)' == '' ">$(GodotProjectDir).godot\mono\temp\obj\</BaseIntermediateOutputPath>
<!-- Do not append the target framework name to the output path. -->
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
</PropertyGroup>
<Target Condition=" $([MSBuild]::VersionLessThan($(MSBuildAssemblyVersion), '17.3')) " Name="GodotProjectDir" BeforeTargets="Build">
<Error Text="Cannot build from path containing '%23', move your project or update dotnet to the latest version." Condition="$(GodotProjectDir.Contains('%23'))" /> <!-- # -->
<Error Text="Cannot build from path containing '%3B', move your project or update dotnet to the latest version." Condition="$(GodotProjectDir.Contains('%3B'))" /> <!-- ; -->
<Error Text="Cannot build from path containing newlines, move your project or update dotnet to the latest version." Condition="$(GodotProjectDir.Contains('%0A'))" /> <!-- \n -->
<Error Text="Cannot build from path containing newlines, move your project or update dotnet to the latest version." Condition="$(GodotProjectDir.Contains('%0D'))" /> <!-- \r -->
</Target>
<Import Sdk="Microsoft.NET.Sdk" Project="Sdk.props" Condition=" '$(GodotSdkImportsMicrosoftNetSdk)' == 'true' " />
<PropertyGroup>
<EnableDefaultNoneItems>false</EnableDefaultNoneItems>
</PropertyGroup>
<!--
The Microsoft.NET.Sdk only understands of the Debug and Release configurations.
We need to set the following properties manually for ExportDebug and ExportRelease.
-->
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' or '$(Configuration)' == 'ExportDebug' ">
<DebugSymbols Condition=" '$(DebugSymbols)' == '' ">true</DebugSymbols>
<Optimize Condition=" '$(Optimize)' == '' ">false</Optimize>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'ExportRelease' ">
<Optimize Condition=" '$(Optimize)' == '' ">true</Optimize>
</PropertyGroup>
<PropertyGroup>
<GodotApiConfiguration Condition=" '$(Configuration)' != 'ExportRelease' ">Debug</GodotApiConfiguration>
<GodotApiConfiguration Condition=" '$(Configuration)' == 'ExportRelease' ">Release</GodotApiConfiguration>
</PropertyGroup>
<!-- Auto-detect the target Godot platform if it was not specified. -->
<PropertyGroup Condition=" '$(GodotTargetPlatform)' == '' ">
<GodotTargetPlatform Condition=" $(RuntimeIdentifier.StartsWith('ios')) ">ios</GodotTargetPlatform>
<GodotTargetPlatform Condition=" '$(GodotTargetPlatform)' == '' and $(RuntimeIdentifier.StartsWith('android')) ">android</GodotTargetPlatform>
<GodotTargetPlatform Condition=" '$(GodotTargetPlatform)' == '' and $(RuntimeIdentifier.StartsWith('browser')) ">web</GodotTargetPlatform>
<GodotTargetPlatform Condition=" '$(GodotTargetPlatform)' == '' and $(RuntimeIdentifier.StartsWith('linux')) ">linuxbsd</GodotTargetPlatform>
<GodotTargetPlatform Condition=" '$(GodotTargetPlatform)' == '' and $(RuntimeIdentifier.StartsWith('freebsd')) ">linuxbsd</GodotTargetPlatform>
<GodotTargetPlatform Condition=" '$(GodotTargetPlatform)' == '' and $(RuntimeIdentifier.StartsWith('osx')) ">macos</GodotTargetPlatform>
<GodotTargetPlatform Condition=" '$(GodotTargetPlatform)' == '' and $(RuntimeIdentifier.StartsWith('win')) ">windows</GodotTargetPlatform>
</PropertyGroup>
<!-- Auto-detect the target Godot platform if it was not specified and there's no runtime identifier information. -->
<PropertyGroup Condition=" '$(GodotTargetPlatform)' == '' ">
<GodotTargetPlatform Condition=" '$([MSBuild]::IsOsPlatform(Linux))' ">linuxbsd</GodotTargetPlatform>
<GodotTargetPlatform Condition=" '$([MSBuild]::IsOsPlatform(FreeBSD))' ">linuxbsd</GodotTargetPlatform>
<GodotTargetPlatform Condition=" '$([MSBuild]::IsOsPlatform(OSX))' ">macos</GodotTargetPlatform>
<GodotTargetPlatform Condition=" '$([MSBuild]::IsOsPlatform(Windows))' ">windows</GodotTargetPlatform>
</PropertyGroup>
<PropertyGroup>
<GodotFloat64 Condition=" '$(GodotFloat64)' == '' ">false</GodotFloat64>
</PropertyGroup>
<!-- Godot DefineConstants. -->
<PropertyGroup>
<!-- Define constants to identify Godot builds. -->
<GodotDefineConstants>GODOT</GodotDefineConstants>
<!--
Define constant to determine the target Godot platform. This includes the
recognized platform names and the platform category (PC, MOBILE or WEB).
-->
<GodotPlatformConstants Condition=" '$(GodotTargetPlatform)' == 'windows' ">GODOT_WINDOWS;GODOT_PC</GodotPlatformConstants>
<GodotPlatformConstants Condition=" '$(GodotTargetPlatform)' == 'linuxbsd' ">GODOT_LINUXBSD;GODOT_PC</GodotPlatformConstants>
<GodotPlatformConstants Condition=" '$(GodotTargetPlatform)' == 'macos' ">GODOT_OSX;GODOT_MACOS;GODOT_PC</GodotPlatformConstants>
<GodotPlatformConstants Condition=" '$(GodotTargetPlatform)' == 'android' ">GODOT_ANDROID;GODOT_MOBILE</GodotPlatformConstants>
<GodotPlatformConstants Condition=" '$(GodotTargetPlatform)' == 'ios' ">GODOT_IPHONE;GODOT_IOS;GODOT_MOBILE</GodotPlatformConstants>
<GodotPlatformConstants Condition=" '$(GodotTargetPlatform)' == 'web' ">GODOT_JAVASCRIPT;GODOT_HTML5;GODOT_WASM;GODOT_WEB</GodotPlatformConstants>
<GodotDefineConstants>$(GodotDefineConstants);$(GodotPlatformConstants);$(GodotVersionConstants)</GodotDefineConstants>
</PropertyGroup>
<Import Project="$(MSBuildThisFileDirectory)\Android.props" Condition=" '$(GodotTargetPlatform)' == 'android' " />
<Import Project="$(MSBuildThisFileDirectory)\iOSNativeAOT.props" Condition=" '$(GodotTargetPlatform)' == 'ios' " />
</Project>

View File

@@ -0,0 +1,40 @@
<Project>
<Import Sdk="Microsoft.NET.Sdk" Project="Sdk.targets" Condition=" '$(GodotSdkImportsMicrosoftNetSdk)' == 'true' " />
<PropertyGroup>
<!--
Define constant to determine whether the real_t type in Godot is double precision or not.
By default this is false, like the official Godot builds. If someone is using a custom
Godot build where real_t is double, they can override the GodotFloat64 property.
-->
<DefineConstants Condition=" '$(GodotFloat64)' == 'true' ">GODOT_REAL_T_IS_DOUBLE;$(DefineConstants)</DefineConstants>
</PropertyGroup>
<!--
We are defining ExportDebug and Debug in Sdk.targets to ensure that the user cannot
override the DefineConstants property in their csproj file and break the editor functionality.
-->
<PropertyGroup>
<!-- ExportDebug also defines DEBUG like Debug does. -->
<DefineConstants Condition=" '$(Configuration)' == 'ExportDebug' ">$(DefineConstants);DEBUG</DefineConstants>
<!-- Debug defines TOOLS to differentiate between Debug and ExportDebug configurations. -->
<DefineConstants Condition=" '$(Configuration)' == 'Debug' ">$(DefineConstants);TOOLS</DefineConstants>
<DefineConstants>$(GodotDefineConstants);$(DefineConstants)</DefineConstants>
</PropertyGroup>
<!-- C# source generators -->
<ItemGroup Condition=" '$(DisableImplicitGodotGeneratorReferences)' != 'true' ">
<PackageReference Include="Godot.SourceGenerators" IsImplicitlyDefined="true" Version="$(PackageVersion_Godot_SourceGenerators)" />
</ItemGroup>
<!-- Godot API references -->
<ItemGroup Condition=" '$(DisableImplicitGodotSharpReferences)' != 'true' ">
<PackageReference Include="GodotSharp" IsImplicitlyDefined="true" Version="$(PackageVersion_GodotSharp)" />
<PackageReference Include="GodotSharpEditor" IsImplicitlyDefined="true" Version="$(PackageVersion_GodotSharp)" Condition=" '$(Configuration)' == 'Debug' " />
</ItemGroup>
<!-- iOS-specific build targets -->
<Import Project="$(MSBuildThisFileDirectory)\iOSNativeAOT.targets" Condition=" '$(GodotTargetPlatform)' == 'ios' " />
</Project>

View File

@@ -0,0 +1,8 @@
<Project>
<PropertyGroup>
<PublishAot>true</PublishAot>
<PublishAotUsingRuntimePack>true</PublishAotUsingRuntimePack>
<UseNativeAOTRuntime>true</UseNativeAOTRuntime>
<TrimmerSingleWarn>false</TrimmerSingleWarn>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1,63 @@
<Project>
<ItemGroup>
<TrimmerRootAssembly Include="GodotSharp" />
<TrimmerRootAssembly Include="$(TargetName)" />
<LinkerArg Include="-install_name '@rpath/$(TargetName)$(NativeBinaryExt)'" />
</ItemGroup>
<PropertyGroup>
<LinkStandardCPlusPlusLibrary>true</LinkStandardCPlusPlusLibrary>
<FindXCode Condition=" '$(XCodePath)' == '' and '$([MSBuild]::IsOsPlatform(OSX))' ">true</FindXCode>
<XCodePath Condition=" '$(XCodePath)' == '' ">/Applications/Xcode.app/Contents/Developer</XCodePath>
<XCodePath>$([MSBuild]::EnsureTrailingSlash('$(XCodePath)'))</XCodePath>
</PropertyGroup>
<Target Name="PrepareBeforeIlcCompile"
BeforeTargets="IlcCompile">
<PropertyGroup>
<IcuTargetDir>%(ResolvedRuntimePack.PackageDirectory)/runtimes/$(RuntimeIdentifier)/native/icudt.dat</IcuTargetDir>
<IcuEnabled Condition="Exists('$(IcuTargetDir)')">true</IcuEnabled>
</PropertyGroup>
<Copy SourceFiles="$(IcuTargetDir)" DestinationFolder="$(PublishDir)" Condition=" '$(IcuEnabled)' == 'true' "/>
<!-- We need to find the path to Xcode so we can set manual linker args to the correct SDKs
Once https://github.com/dotnet/runtime/issues/88737 is released, we can take this out
-->
<Exec Command="xcrun xcode-select -p" ConsoleToMSBuild="true" Condition=" '$(FindXCode)' == 'true' ">
<Output TaskParameter="ConsoleOutput" PropertyName="XcodeSelect" />
</Exec>
<PropertyGroup Condition=" '$(FindXCode)' == 'true' ">
<XCodePath>$(XcodeSelect)</XCodePath>
<XCodePath>$([MSBuild]::EnsureTrailingSlash('$(XCodePath)'))</XCodePath>
</PropertyGroup>
<Message Importance="normal" Text="Found XCode at $(XcodeSelect)" Condition=" '$(FindXCode)' == 'true' "/>
<ItemGroup>
<LinkerArg Include="-mios-simulator-version-min=12.0 -isysroot %22$(XCodePath)Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk%22"
Condition=" $(RuntimeIdentifier.Contains('simulator')) "/>
<LinkerArg Include="-miphoneos-version-min=12.0 -isysroot %22$(XCodePath)Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk%22"
Condition=" !$(RuntimeIdentifier.Contains('simulator')) "/>
</ItemGroup>
</Target>
<Target Name="FixSymbols"
AfterTargets="Publish">
<RemoveDir Directories="$(PublishDir)$(TargetName).framework.dSYM"/>
<!-- create-xcframework (called from the export plugin wants the symbol files in a directory
with a slightly different name from the one created by dotnet publish, so we copy them over
to the correctly-named directory -->
<ItemGroup>
<SymbolFiles Include="$(NativeBinary).dsym\**\*.*"/>
</ItemGroup>
<Copy SourceFiles="@(SymbolFiles)" DestinationFolder="$(PublishDir)$(TargetName).framework.dSYM"/>
</Target>
</Project>

View File

@@ -0,0 +1,15 @@
namespace Godot.SourceGenerators.Sample
{
public partial class Bar : GodotObject
{
}
// Foo in another file
public partial class Foo
{
}
public partial class NotSameNameAsFile : GodotObject
{
}
}

View File

@@ -0,0 +1,7 @@
namespace Godot.SourceGenerators.Sample;
public partial class EventSignals : GodotObject
{
[Signal]
public delegate void MySignalEventHandler(string str, int num);
}

View File

@@ -0,0 +1,26 @@
using Godot;
namespace Godot.SourceGenerators.Sample
{
public partial class ExportedComplexStrings : Node
{
[Export]
private string _fieldInterpolated1 = $"The quick brown fox jumps over ({Engine.GetVersionInfo()})";
[Export]
private string _fieldInterpolated2 = $"The quick brown fox jumps over ({Engine.GetVersionInfo()["major"],0:G}) the lazy dog.";
[Export]
private string _fieldInterpolated3 = $"{((int)Engine.GetVersionInfo()["major"]) * -1 * -1:G} the lazy dog.";
[Export]
private string _fieldInterpolated4 = $"{":::fff,,}<,<}},,}]"}";
[Export]
public string PropertyInterpolated1
{
get;
private set;
} = $"The quick brown fox jumps over {GD.VarToStr($"the lazy {Engine.GetVersionInfo()} do")}g.";
}
}

View File

@@ -0,0 +1,118 @@
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
#pragma warning disable CS0169
#pragma warning disable CS0414
namespace Godot.SourceGenerators.Sample
{
[SuppressMessage("ReSharper", "BuiltInTypeReferenceStyle")]
[SuppressMessage("ReSharper", "RedundantNameQualifier")]
[SuppressMessage("ReSharper", "ArrangeObjectCreationWhenTypeEvident")]
[SuppressMessage("ReSharper", "InconsistentNaming")]
public partial class ExportedFields : GodotObject
{
[Export] private Boolean _fieldBoolean = true;
[Export] private Char _fieldChar = 'f';
[Export] private SByte _fieldSByte = 10;
[Export] private Int16 _fieldInt16 = 10;
[Export] private Int32 _fieldInt32 = 10;
[Export] private Int64 _fieldInt64 = 10;
[Export] private Byte _fieldByte = 10;
[Export] private UInt16 _fieldUInt16 = 10;
[Export] private UInt32 _fieldUInt32 = 10;
[Export] private UInt64 _fieldUInt64 = 10;
[Export] private Single _fieldSingle = 10;
[Export] private Double _fieldDouble = 10;
[Export] private String _fieldString = "foo";
// Godot structs
[Export] private Vector2 _fieldVector2 = new(10f, 10f);
[Export] private Vector2I _fieldVector2I = Vector2I.Up;
[Export] private Rect2 _fieldRect2 = new(new Vector2(10f, 10f), new Vector2(10f, 10f));
[Export] private Rect2I _fieldRect2I = new(new Vector2I(10, 10), new Vector2I(10, 10));
[Export] private Transform2D _fieldTransform2D = Transform2D.Identity;
[Export] private Vector3 _fieldVector3 = new(10f, 10f, 10f);
[Export] private Vector3I _fieldVector3I = Vector3I.Back;
[Export] private Basis _fieldBasis = new Basis(Quaternion.Identity);
[Export] private Quaternion _fieldQuaternion = new Quaternion(Basis.Identity);
[Export] private Transform3D _fieldTransform3D = Transform3D.Identity;
[Export] private Vector4 _fieldVector4 = new(10f, 10f, 10f, 10f);
[Export] private Vector4I _fieldVector4I = Vector4I.One;
[Export] private Projection _fieldProjection = Projection.Identity;
[Export] private Aabb _fieldAabb = new Aabb(10f, 10f, 10f, new Vector3(1f, 1f, 1f));
[Export] private Color _fieldColor = Colors.Aquamarine;
[Export] private Plane _fieldPlane = Plane.PlaneXZ;
[Export] private Callable _fieldCallable = new Callable(Engine.GetMainLoop(), "_process");
[Export] private Signal _fieldSignal = new Signal(Engine.GetMainLoop(), "property_list_changed");
// Enums
[SuppressMessage("ReSharper", "UnusedMember.Local")]
public enum MyEnum
{
A,
B,
C
}
[Export] private MyEnum _fieldEnum = MyEnum.C;
[Flags]
[SuppressMessage("ReSharper", "UnusedMember.Local")]
public enum MyFlagsEnum
{
A,
B,
C
}
[Export] private MyFlagsEnum _fieldFlagsEnum = MyFlagsEnum.C;
// Arrays
[Export] private Byte[] _fieldByteArray = { 0, 1, 2, 3, 4, 5, 6 };
[Export] private Int32[] _fieldInt32Array = { 0, 1, 2, 3, 4, 5, 6 };
[Export] private Int64[] _fieldInt64Array = { 0, 1, 2, 3, 4, 5, 6 };
[Export] private Single[] _fieldSingleArray = { 0f, 1f, 2f, 3f, 4f, 5f, 6f };
[Export] private Double[] _fieldDoubleArray = { 0d, 1d, 2d, 3d, 4d, 5d, 6d };
[Export] private String[] _fieldStringArray = { "foo", "bar" };
[Export(PropertyHint.Enum, "A,B,C")] private String[] _fieldStringArrayEnum = { "foo", "bar" };
[Export] private Vector2[] _fieldVector2Array = { Vector2.Up, Vector2.Down, Vector2.Left, Vector2.Right };
[Export] private Vector3[] _fieldVector3Array = { Vector3.Up, Vector3.Down, Vector3.Left, Vector3.Right };
[Export] private Color[] _fieldColorArray = { Colors.Aqua, Colors.Aquamarine, Colors.Azure, Colors.Beige };
[Export] private GodotObject[] _fieldGodotObjectOrDerivedArray = { null };
[Export] private StringName[] _fieldStringNameArray = { "foo", "bar" };
[Export] private NodePath[] _fieldNodePathArray = { "foo", "bar" };
[Export] private Rid[] _fieldRidArray = { default, default, default };
// Note we use Array and not System.Array. This tests the generated namespace qualification.
[Export] private Int32[] _fieldEmptyInt32Array = Array.Empty<Int32>();
// Note we use List and not System.Collections.Generic.
[Export] private int[] _fieldArrayFromList = new List<int>(Array.Empty<int>()).ToArray();
// Variant
[Export] private Variant _fieldVariant = "foo";
// Classes
[Export] private GodotObject _fieldGodotObjectOrDerived;
[Export] private Godot.Texture _fieldGodotResourceTexture;
[Export] private StringName _fieldStringName = new StringName("foo");
[Export] private NodePath _fieldNodePath = new NodePath("foo");
[Export] private Rid _fieldRid;
[Export]
private Godot.Collections.Dictionary _fieldGodotDictionary =
new() { { "foo", 10 }, { Vector2.Up, Colors.Chocolate } };
[Export]
private Godot.Collections.Array _fieldGodotArray =
new() { "foo", 10, Vector2.Up, Colors.Chocolate };
[Export]
private Godot.Collections.Dictionary<string, bool> _fieldGodotGenericDictionary =
new() { { "foo", true }, { "bar", false } };
[Export]
private Godot.Collections.Array<int> _fieldGodotGenericArray =
new() { 0, 1, 2, 3, 4, 5, 6 };
}
}

View File

@@ -0,0 +1,202 @@
using System;
using System.Diagnostics.CodeAnalysis;
#pragma warning disable CS0169
#pragma warning disable CS0414
namespace Godot.SourceGenerators.Sample
{
[SuppressMessage("ReSharper", "BuiltInTypeReferenceStyle")]
[SuppressMessage("ReSharper", "RedundantNameQualifier")]
[SuppressMessage("ReSharper", "ArrangeObjectCreationWhenTypeEvident")]
[SuppressMessage("ReSharper", "InconsistentNaming")]
public partial class ExportedProperties : GodotObject
{
// Do not generate default value
private String _notGeneratePropertyString = new string("not generate");
[Export]
public String NotGenerateComplexLambdaProperty
{
get => _notGeneratePropertyString + Convert.ToInt32("1");
set => _notGeneratePropertyString = value;
}
[Export]
public String NotGenerateLambdaNoFieldProperty
{
get => new string("not generate");
set => _notGeneratePropertyString = value;
}
[Export]
public String NotGenerateComplexReturnProperty
{
get
{
return _notGeneratePropertyString + Convert.ToInt32("1");
}
set
{
_notGeneratePropertyString = value;
}
}
private int _notGeneratePropertyInt = 1;
[Export]
public string NotGenerate_Returns_Property
{
get
{
if (_notGeneratePropertyInt == 1)
{
return "a";
}
else
{
return "b";
}
}
set
{
_notGeneratePropertyInt = value == "a" ? 1 : 2;
}
}
// Full Property
private String _fullPropertyString = "FullPropertyString";
[Export]
public String FullPropertyString
{
get
{
return _fullPropertyString;
}
set
{
_fullPropertyString = value;
}
}
private String _fullPropertyStringComplex = new string("FullPropertyString_Complex") + Convert.ToInt32("1");
[Export]
public String FullPropertyStringComplex
{
get
{
return _fullPropertyStringComplex;
}
set
{
_fullPropertyStringComplex = value;
}
}
// Lambda Property
private String _lamdaPropertyString = "LamdaPropertyString";
[Export]
public String LamdaPropertyString
{
get => _lamdaPropertyString;
set => _lamdaPropertyString = value;
}
// Auto Property
[Export] private Boolean PropertyBoolean { get; set; } = true;
[Export] private Char PropertyChar { get; set; } = 'f';
[Export] private SByte PropertySByte { get; set; } = 10;
[Export] private Int16 PropertyInt16 { get; set; } = 10;
[Export] private Int32 PropertyInt32 { get; set; } = 10;
[Export] private Int64 PropertyInt64 { get; set; } = 10;
[Export] private Byte PropertyByte { get; set; } = 10;
[Export] private UInt16 PropertyUInt16 { get; set; } = 10;
[Export] private UInt32 PropertyUInt32 { get; set; } = 10;
[Export] private UInt64 PropertyUInt64 { get; set; } = 10;
[Export] private Single PropertySingle { get; set; } = 10;
[Export] private Double PropertyDouble { get; set; } = 10;
[Export] private String PropertyString { get; set; } = "foo";
// Godot structs
[Export] private Vector2 PropertyVector2 { get; set; } = new(10f, 10f);
[Export] private Vector2I PropertyVector2I { get; set; } = Vector2I.Up;
[Export] private Rect2 PropertyRect2 { get; set; } = new(new Vector2(10f, 10f), new Vector2(10f, 10f));
[Export] private Rect2I PropertyRect2I { get; set; } = new(new Vector2I(10, 10), new Vector2I(10, 10));
[Export] private Transform2D PropertyTransform2D { get; set; } = Transform2D.Identity;
[Export] private Vector3 PropertyVector3 { get; set; } = new(10f, 10f, 10f);
[Export] private Vector3I PropertyVector3I { get; set; } = Vector3I.Back;
[Export] private Basis PropertyBasis { get; set; } = new Basis(Quaternion.Identity);
[Export] private Quaternion PropertyQuaternion { get; set; } = new Quaternion(Basis.Identity);
[Export] private Transform3D PropertyTransform3D { get; set; } = Transform3D.Identity;
[Export] private Vector4 PropertyVector4 { get; set; } = new(10f, 10f, 10f, 10f);
[Export] private Vector4I PropertyVector4I { get; set; } = Vector4I.One;
[Export] private Projection PropertyProjection { get; set; } = Projection.Identity;
[Export] private Aabb PropertyAabb { get; set; } = new Aabb(10f, 10f, 10f, new Vector3(1f, 1f, 1f));
[Export] private Color PropertyColor { get; set; } = Colors.Aquamarine;
[Export] private Plane PropertyPlane { get; set; } = Plane.PlaneXZ;
[Export] private Callable PropertyCallable { get; set; } = new Callable(Engine.GetMainLoop(), "_process");
[Export] private Signal PropertySignal { get; set; } = new Signal(Engine.GetMainLoop(), "Propertylist_changed");
// Enums
[SuppressMessage("ReSharper", "UnusedMember.Local")]
public enum MyEnum
{
A,
B,
C
}
[Export] private MyEnum PropertyEnum { get; set; } = MyEnum.C;
[Flags]
[SuppressMessage("ReSharper", "UnusedMember.Local")]
public enum MyFlagsEnum
{
A,
B,
C
}
[Export] private MyFlagsEnum PropertyFlagsEnum { get; set; } = MyFlagsEnum.C;
// Arrays
[Export] private Byte[] PropertyByteArray { get; set; } = { 0, 1, 2, 3, 4, 5, 6 };
[Export] private Int32[] PropertyInt32Array { get; set; } = { 0, 1, 2, 3, 4, 5, 6 };
[Export] private Int64[] PropertyInt64Array { get; set; } = { 0, 1, 2, 3, 4, 5, 6 };
[Export] private Single[] PropertySingleArray { get; set; } = { 0f, 1f, 2f, 3f, 4f, 5f, 6f };
[Export] private Double[] PropertyDoubleArray { get; set; } = { 0d, 1d, 2d, 3d, 4d, 5d, 6d };
[Export] private String[] PropertyStringArray { get; set; } = { "foo", "bar" };
[Export(PropertyHint.Enum, "A,B,C")] private String[] PropertyStringArrayEnum { get; set; } = { "foo", "bar" };
[Export] private Vector2[] PropertyVector2Array { get; set; } = { Vector2.Up, Vector2.Down, Vector2.Left, Vector2.Right };
[Export] private Vector3[] PropertyVector3Array { get; set; } = { Vector3.Up, Vector3.Down, Vector3.Left, Vector3.Right };
[Export] private Color[] PropertyColorArray { get; set; } = { Colors.Aqua, Colors.Aquamarine, Colors.Azure, Colors.Beige };
[Export] private GodotObject[] PropertyGodotObjectOrDerivedArray { get; set; } = { null };
[Export] private StringName[] PropertyStringNameArray { get; set; } = { "foo", "bar" };
[Export] private NodePath[] PropertyNodePathArray { get; set; } = { "foo", "bar" };
[Export] private Rid[] PropertyRidArray { get; set; } = { default, default, default };
// Variant
[Export] private Variant PropertyVariant { get; set; } = "foo";
// Classes
[Export] private GodotObject PropertyGodotObjectOrDerived { get; set; }
[Export] private Godot.Texture PropertyGodotResourceTexture { get; set; }
[Export] private StringName PropertyStringName { get; set; } = new StringName("foo");
[Export] private NodePath PropertyNodePath { get; set; } = new NodePath("foo");
[Export] private Rid PropertyRid { get; set; }
[Export]
private Godot.Collections.Dictionary PropertyGodotDictionary { get; set; } =
new() { { "foo", 10 }, { Vector2.Up, Colors.Chocolate } };
[Export]
private Godot.Collections.Array PropertyGodotArray { get; set; } =
new() { "foo", 10, Vector2.Up, Colors.Chocolate };
[Export]
private Godot.Collections.Dictionary<string, bool> PropertyGodotGenericDictionary { get; set; } =
new() { { "foo", true }, { "bar", false } };
[Export]
private Godot.Collections.Array<int> PropertyGodotGenericArray { get; set; } =
new() { 0, 1, 2, 3, 4, 5, 6 };
}
}

View File

@@ -0,0 +1,11 @@
namespace Godot.SourceGenerators.Sample
{
public partial class Foo : GodotObject
{
}
// Foo again in the same file
public partial class Foo
{
}
}

View File

@@ -0,0 +1,10 @@
#pragma warning disable CS0169
namespace Godot.SourceGenerators.Sample
{
// Generic again but without generic parameters
public partial class Generic : GodotObject
{
private int _field;
}
}

View File

@@ -0,0 +1,9 @@
#pragma warning disable CS0169
namespace Godot.SourceGenerators.Sample
{
public partial class Generic1T<T> : GodotObject
{
private int _field;
}
}

View File

@@ -0,0 +1,10 @@
#pragma warning disable CS0169
namespace Godot.SourceGenerators.Sample
{
// Generic again but different generic parameters
public partial class Generic2T<T, R> : GodotObject
{
private int _field;
}
}

View File

@@ -0,0 +1,14 @@
namespace Godot.SourceGenerators.Sample;
[GlobalClass]
public partial class CustomGlobalClass : GodotObject
{
}
// This doesn't works because global classes can't have any generic type parameter.
/*
[GlobalClass]
public partial class CustomGlobalClass<T> : Node
{
}
*/

View File

@@ -0,0 +1,35 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>12</LangVersion>
</PropertyGroup>
<PropertyGroup>
<!-- $(GodotProjectDir) would normally be defined by the Godot.NET.Sdk -->
<GodotProjectDir>$(MSBuildProjectDirectory)</GodotProjectDir>
<GodotProjectDirBase64 Condition=" $([MSBuild]::VersionGreaterThanOrEquals($(MSBuildAssemblyVersion), '17.3')) ">$([MSBuild]::ConvertToBase64('$(GodotProjectDir)'))</GodotProjectDirBase64>
<!-- For compiling GetGodotPropertyDefaultValues. -->
<DefineConstants>$(DefineConstants);TOOLS</DefineConstants>
</PropertyGroup>
<PropertyGroup>
<!-- The emitted files are not part of the compilation nor design.
They're only for peeking at the generated sources. Sometimes the
emitted files get corrupted, but that won't break anything. -->
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
<CompilerGeneratedFilesOutputPath>$(BaseIntermediateOutputPath)\GeneratedFiles</CompilerGeneratedFilesOutputPath>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\glue\GodotSharp\GodotSharp\GodotSharp.csproj">
<Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\Godot.SourceGenerators\Godot.SourceGenerators.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
</ItemGroup>
<!-- This file is imported automatically when using PackageReference to
reference Godot.SourceGenerators, but not when using ProjectReference -->
<Import Project="..\Godot.SourceGenerators\Godot.SourceGenerators.props" />
</Project>

View File

@@ -0,0 +1,31 @@
using System.Diagnostics.CodeAnalysis;
namespace Godot.SourceGenerators.Sample;
[SuppressMessage("ReSharper", "RedundantNameQualifier")]
public partial class Methods : GodotObject
{
private void MethodWithOverload()
{
}
private void MethodWithOverload(int a)
{
}
private void MethodWithOverload(int a, int b)
{
}
// Should be ignored. The previous one is picked.
// ReSharper disable once UnusedMember.Local
private void MethodWithOverload(float a, float b)
{
}
// Generic methods should be ignored.
// ReSharper disable once UnusedMember.Local
private void GenericMethod<T>(T t)
{
}
}

View File

@@ -0,0 +1,19 @@
using System;
using System.Diagnostics.CodeAnalysis;
#pragma warning disable CS0169
#pragma warning disable CS0414
namespace Godot.SourceGenerators.Sample
{
[SuppressMessage("ReSharper", "BuiltInTypeReferenceStyle")]
[SuppressMessage("ReSharper", "RedundantNameQualifier")]
[SuppressMessage("ReSharper", "ArrangeObjectCreationWhenTypeEvident")]
[SuppressMessage("ReSharper", "InconsistentNaming")]
// We split the definition of ExportedFields to verify properties work across multiple files.
public partial class ExportedFields : GodotObject
{
// Note we use Array and not System.Array. This tests the generated namespace qualification.
[Export] private Int64[] _fieldEmptyInt64Array = Array.Empty<Int64>();
}
}

View File

@@ -0,0 +1,654 @@
using System;
using Godot.Collections;
using Array = Godot.Collections.Array;
namespace Godot.SourceGenerators.Sample;
public class MustBeVariantMethods
{
public void MustBeVariantMethodCalls()
{
Method<bool>();
Method<char>();
Method<sbyte>();
Method<byte>();
Method<short>();
Method<ushort>();
Method<int>();
Method<uint>();
Method<long>();
Method<ulong>();
Method<float>();
Method<double>();
Method<string>();
Method<Vector2>();
Method<Vector2I>();
Method<Rect2>();
Method<Rect2I>();
Method<Transform2D>();
Method<Vector3>();
Method<Vector3I>();
Method<Vector4>();
Method<Vector4I>();
Method<Basis>();
Method<Quaternion>();
Method<Transform3D>();
Method<Projection>();
Method<Aabb>();
Method<Color>();
Method<Plane>();
Method<Callable>();
Method<Signal>();
Method<GodotObject>();
Method<StringName>();
Method<NodePath>();
Method<Rid>();
Method<Dictionary>();
Method<Array>();
Method<byte[]>();
Method<int[]>();
Method<long[]>();
Method<float[]>();
Method<double[]>();
Method<string[]>();
Method<Vector2[]>();
Method<Vector3[]>();
Method<Color[]>();
Method<GodotObject[]>();
Method<StringName[]>();
Method<NodePath[]>();
Method<Rid[]>();
// This call fails because generic type is not Variant-compatible.
//Method<object>();
}
public void Method<[MustBeVariant] T>()
{
}
public void MustBeVariantClasses()
{
new ClassWithGenericVariant<bool>();
new ClassWithGenericVariant<char>();
new ClassWithGenericVariant<sbyte>();
new ClassWithGenericVariant<byte>();
new ClassWithGenericVariant<short>();
new ClassWithGenericVariant<ushort>();
new ClassWithGenericVariant<int>();
new ClassWithGenericVariant<uint>();
new ClassWithGenericVariant<long>();
new ClassWithGenericVariant<ulong>();
new ClassWithGenericVariant<float>();
new ClassWithGenericVariant<double>();
new ClassWithGenericVariant<string>();
new ClassWithGenericVariant<Vector2>();
new ClassWithGenericVariant<Vector2I>();
new ClassWithGenericVariant<Rect2>();
new ClassWithGenericVariant<Rect2I>();
new ClassWithGenericVariant<Transform2D>();
new ClassWithGenericVariant<Vector3>();
new ClassWithGenericVariant<Vector3I>();
new ClassWithGenericVariant<Vector4>();
new ClassWithGenericVariant<Vector4I>();
new ClassWithGenericVariant<Basis>();
new ClassWithGenericVariant<Quaternion>();
new ClassWithGenericVariant<Transform3D>();
new ClassWithGenericVariant<Projection>();
new ClassWithGenericVariant<Aabb>();
new ClassWithGenericVariant<Color>();
new ClassWithGenericVariant<Plane>();
new ClassWithGenericVariant<Callable>();
new ClassWithGenericVariant<Signal>();
new ClassWithGenericVariant<GodotObject>();
new ClassWithGenericVariant<StringName>();
new ClassWithGenericVariant<NodePath>();
new ClassWithGenericVariant<Rid>();
new ClassWithGenericVariant<Dictionary>();
new ClassWithGenericVariant<Array>();
new ClassWithGenericVariant<byte[]>();
new ClassWithGenericVariant<int[]>();
new ClassWithGenericVariant<long[]>();
new ClassWithGenericVariant<float[]>();
new ClassWithGenericVariant<double[]>();
new ClassWithGenericVariant<string[]>();
new ClassWithGenericVariant<Vector2[]>();
new ClassWithGenericVariant<Vector3[]>();
new ClassWithGenericVariant<Color[]>();
new ClassWithGenericVariant<GodotObject[]>();
new ClassWithGenericVariant<StringName[]>();
new ClassWithGenericVariant<NodePath[]>();
new ClassWithGenericVariant<Rid[]>();
// This class fails because generic type is not Variant-compatible.
//new ClassWithGenericVariant<object>();
}
}
public class ClassWithGenericVariant<[MustBeVariant] T>
{
}
public class MustBeVariantAnnotatedMethods
{
[GenericTypeAttribute<bool>()]
public void MethodWithAttributeBool()
{
}
[GenericTypeAttribute<char>()]
public void MethodWithAttributeChar()
{
}
[GenericTypeAttribute<sbyte>()]
public void MethodWithAttributeSByte()
{
}
[GenericTypeAttribute<byte>()]
public void MethodWithAttributeByte()
{
}
[GenericTypeAttribute<short>()]
public void MethodWithAttributeInt16()
{
}
[GenericTypeAttribute<ushort>()]
public void MethodWithAttributeUInt16()
{
}
[GenericTypeAttribute<int>()]
public void MethodWithAttributeInt32()
{
}
[GenericTypeAttribute<uint>()]
public void MethodWithAttributeUInt32()
{
}
[GenericTypeAttribute<long>()]
public void MethodWithAttributeInt64()
{
}
[GenericTypeAttribute<ulong>()]
public void MethodWithAttributeUInt64()
{
}
[GenericTypeAttribute<float>()]
public void MethodWithAttributeSingle()
{
}
[GenericTypeAttribute<double>()]
public void MethodWithAttributeDouble()
{
}
[GenericTypeAttribute<string>()]
public void MethodWithAttributeString()
{
}
[GenericTypeAttribute<Vector2>()]
public void MethodWithAttributeVector2()
{
}
[GenericTypeAttribute<Vector2I>()]
public void MethodWithAttributeVector2I()
{
}
[GenericTypeAttribute<Rect2>()]
public void MethodWithAttributeRect2()
{
}
[GenericTypeAttribute<Rect2I>()]
public void MethodWithAttributeRect2I()
{
}
[GenericTypeAttribute<Transform2D>()]
public void MethodWithAttributeTransform2D()
{
}
[GenericTypeAttribute<Vector3>()]
public void MethodWithAttributeVector3()
{
}
[GenericTypeAttribute<Vector3I>()]
public void MethodWithAttributeVector3I()
{
}
[GenericTypeAttribute<Vector4>()]
public void MethodWithAttributeVector4()
{
}
[GenericTypeAttribute<Vector4I>()]
public void MethodWithAttributeVector4I()
{
}
[GenericTypeAttribute<Basis>()]
public void MethodWithAttributeBasis()
{
}
[GenericTypeAttribute<Quaternion>()]
public void MethodWithAttributeQuaternion()
{
}
[GenericTypeAttribute<Transform3D>()]
public void MethodWithAttributeTransform3D()
{
}
[GenericTypeAttribute<Projection>()]
public void MethodWithAttributeProjection()
{
}
[GenericTypeAttribute<Aabb>()]
public void MethodWithAttributeAabb()
{
}
[GenericTypeAttribute<Color>()]
public void MethodWithAttributeColor()
{
}
[GenericTypeAttribute<Plane>()]
public void MethodWithAttributePlane()
{
}
[GenericTypeAttribute<Callable>()]
public void MethodWithAttributeCallable()
{
}
[GenericTypeAttribute<Signal>()]
public void MethodWithAttributeSignal()
{
}
[GenericTypeAttribute<GodotObject>()]
public void MethodWithAttributeGodotObject()
{
}
[GenericTypeAttribute<StringName>()]
public void MethodWithAttributeStringName()
{
}
[GenericTypeAttribute<NodePath>()]
public void MethodWithAttributeNodePath()
{
}
[GenericTypeAttribute<Rid>()]
public void MethodWithAttributeRid()
{
}
[GenericTypeAttribute<Dictionary>()]
public void MethodWithAttributeDictionary()
{
}
[GenericTypeAttribute<Array>()]
public void MethodWithAttributeArray()
{
}
[GenericTypeAttribute<byte[]>()]
public void MethodWithAttributeByteArray()
{
}
[GenericTypeAttribute<int[]>()]
public void MethodWithAttributeInt32Array()
{
}
[GenericTypeAttribute<long[]>()]
public void MethodWithAttributeInt64Array()
{
}
[GenericTypeAttribute<float[]>()]
public void MethodWithAttributeSingleArray()
{
}
[GenericTypeAttribute<double[]>()]
public void MethodWithAttributeDoubleArray()
{
}
[GenericTypeAttribute<string[]>()]
public void MethodWithAttributeStringArray()
{
}
[GenericTypeAttribute<Vector2[]>()]
public void MethodWithAttributeVector2Array()
{
}
[GenericTypeAttribute<Vector3[]>()]
public void MethodWithAttributeVector3Array()
{
}
[GenericTypeAttribute<Color[]>()]
public void MethodWithAttributeColorArray()
{
}
[GenericTypeAttribute<GodotObject[]>()]
public void MethodWithAttributeGodotObjectArray()
{
}
[GenericTypeAttribute<StringName[]>()]
public void MethodWithAttributeStringNameArray()
{
}
[GenericTypeAttribute<NodePath[]>()]
public void MethodWithAttributeNodePathArray()
{
}
[GenericTypeAttribute<Rid[]>()]
public void MethodWithAttributeRidArray()
{
}
// This method definition fails because generic type is not Variant-compatible.
/*
[GenericTypeAttribute<object>()]
public void MethodWithWrongAttribute()
{
}
*/
}
[GenericTypeAttribute<bool>()]
public class ClassVariantAnnotatedBool
{
}
[GenericTypeAttribute<char>()]
public class ClassVariantAnnotatedChar
{
}
[GenericTypeAttribute<sbyte>()]
public class ClassVariantAnnotatedSByte
{
}
[GenericTypeAttribute<byte>()]
public class ClassVariantAnnotatedByte
{
}
[GenericTypeAttribute<short>()]
public class ClassVariantAnnotatedInt16
{
}
[GenericTypeAttribute<ushort>()]
public class ClassVariantAnnotatedUInt16
{
}
[GenericTypeAttribute<int>()]
public class ClassVariantAnnotatedInt32
{
}
[GenericTypeAttribute<uint>()]
public class ClassVariantAnnotatedUInt32
{
}
[GenericTypeAttribute<long>()]
public class ClassVariantAnnotatedInt64
{
}
[GenericTypeAttribute<ulong>()]
public class ClassVariantAnnotatedUInt64
{
}
[GenericTypeAttribute<float>()]
public class ClassVariantAnnotatedSingle
{
}
[GenericTypeAttribute<double>()]
public class ClassVariantAnnotatedDouble
{
}
[GenericTypeAttribute<string>()]
public class ClassVariantAnnotatedString
{
}
[GenericTypeAttribute<Vector2>()]
public class ClassVariantAnnotatedVector2
{
}
[GenericTypeAttribute<Vector2I>()]
public class ClassVariantAnnotatedVector2I
{
}
[GenericTypeAttribute<Rect2>()]
public class ClassVariantAnnotatedRect2
{
}
[GenericTypeAttribute<Rect2I>()]
public class ClassVariantAnnotatedRect2I
{
}
[GenericTypeAttribute<Transform2D>()]
public class ClassVariantAnnotatedTransform2D
{
}
[GenericTypeAttribute<Vector3>()]
public class ClassVariantAnnotatedVector3
{
}
[GenericTypeAttribute<Vector3I>()]
public class ClassVariantAnnotatedVector3I
{
}
[GenericTypeAttribute<Vector4>()]
public class ClassVariantAnnotatedVector4
{
}
[GenericTypeAttribute<Vector4I>()]
public class ClassVariantAnnotatedVector4I
{
}
[GenericTypeAttribute<Basis>()]
public class ClassVariantAnnotatedBasis
{
}
[GenericTypeAttribute<Quaternion>()]
public class ClassVariantAnnotatedQuaternion
{
}
[GenericTypeAttribute<Transform3D>()]
public class ClassVariantAnnotatedTransform3D
{
}
[GenericTypeAttribute<Projection>()]
public class ClassVariantAnnotatedProjection
{
}
[GenericTypeAttribute<Aabb>()]
public class ClassVariantAnnotatedAabb
{
}
[GenericTypeAttribute<Color>()]
public class ClassVariantAnnotatedColor
{
}
[GenericTypeAttribute<Plane>()]
public class ClassVariantAnnotatedPlane
{
}
[GenericTypeAttribute<Callable>()]
public class ClassVariantAnnotatedCallable
{
}
[GenericTypeAttribute<Signal>()]
public class ClassVariantAnnotatedSignal
{
}
[GenericTypeAttribute<GodotObject>()]
public class ClassVariantAnnotatedGodotObject
{
}
[GenericTypeAttribute<StringName>()]
public class ClassVariantAnnotatedStringName
{
}
[GenericTypeAttribute<NodePath>()]
public class ClassVariantAnnotatedNodePath
{
}
[GenericTypeAttribute<Rid>()]
public class ClassVariantAnnotatedRid
{
}
[GenericTypeAttribute<Dictionary>()]
public class ClassVariantAnnotatedDictionary
{
}
[GenericTypeAttribute<Array>()]
public class ClassVariantAnnotatedArray
{
}
[GenericTypeAttribute<byte[]>()]
public class ClassVariantAnnotatedByteArray
{
}
[GenericTypeAttribute<int[]>()]
public class ClassVariantAnnotatedInt32Array
{
}
[GenericTypeAttribute<long[]>()]
public class ClassVariantAnnotatedInt64Array
{
}
[GenericTypeAttribute<float[]>()]
public class ClassVariantAnnotatedSingleArray
{
}
[GenericTypeAttribute<double[]>()]
public class ClassVariantAnnotatedDoubleArray
{
}
[GenericTypeAttribute<string[]>()]
public class ClassVariantAnnotatedStringArray
{
}
[GenericTypeAttribute<Vector2[]>()]
public class ClassVariantAnnotatedVector2Array
{
}
[GenericTypeAttribute<Vector3[]>()]
public class ClassVariantAnnotatedVector3Array
{
}
[GenericTypeAttribute<Color[]>()]
public class ClassVariantAnnotatedColorArray
{
}
[GenericTypeAttribute<GodotObject[]>()]
public class ClassVariantAnnotatedGodotObjectArray
{
}
[GenericTypeAttribute<StringName[]>()]
public class ClassVariantAnnotatedStringNameArray
{
}
[GenericTypeAttribute<NodePath[]>()]
public class ClassVariantAnnotatedNodePathArray
{
}
[GenericTypeAttribute<Rid[]>()]
public class ClassVariantAnnotatedRidArray
{
}
// This class definition fails because generic type is not Variant-compatible.
/*
[GenericTypeAttribute<object>()]
public class ClassNonVariantAnnotated
{
}
*/
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true)]
public class GenericTypeAttribute<[MustBeVariant] T> : Attribute
{
}

View File

@@ -0,0 +1,22 @@
using System;
namespace Godot.SourceGenerators.Sample;
public partial class NestedClass : GodotObject
{
public partial class NestedClass2 : GodotObject
{
public partial class NestedClass3 : GodotObject
{
[Signal]
public delegate void MySignalEventHandler(string str, int num);
[Export] private String _fieldString = "foo";
[Export] private String PropertyString { get; set; } = "foo";
private void Method()
{
}
}
}
}

View File

@@ -0,0 +1,10 @@
namespace Godot.SourceGenerators.Sample
{
public partial class AllReadOnly : GodotObject
{
public readonly string ReadonlyField = "foo";
public string ReadonlyAutoProperty { get; } = "foo";
public string ReadonlyProperty { get => "foo"; }
public string InitonlyAutoProperty { get; init; }
}
}

View File

@@ -0,0 +1,10 @@
using System;
namespace Godot.SourceGenerators.Sample
{
public partial class AllWriteOnly : GodotObject
{
private bool _writeOnlyBackingField = false;
public bool WriteOnlyProperty { set => _writeOnlyBackingField = value; }
}
}

View File

@@ -0,0 +1,13 @@
namespace Godot.SourceGenerators.Sample
{
public partial class MixedReadonlyWriteOnly : GodotObject
{
public readonly string ReadOnlyField = "foo";
public string ReadOnlyAutoProperty { get; } = "foo";
public string ReadOnlyProperty { get => "foo"; }
public string InitOnlyAutoProperty { get; init; }
private bool _writeOnlyBackingField = false;
public bool WriteOnlyProperty { set => _writeOnlyBackingField = value; }
}
}

View File

@@ -0,0 +1,36 @@
#pragma warning disable CS0169
namespace Godot.SourceGenerators.Sample
{
public partial class ScriptBoilerplate : Node
{
private NodePath _nodePath;
private int _velocity;
public override void _Process(double delta)
{
_ = delta;
base._Process(delta);
}
public int Bazz(StringName name)
{
_ = name;
return 1;
}
public void IgnoreThisMethodWithByRefParams(ref int a)
{
_ = a;
}
}
public partial struct OuterClass
{
public partial class NesterClass : RefCounted
{
public override Variant _Get(StringName property) => default;
}
}
}

View File

@@ -0,0 +1,59 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Testing;
using Microsoft.CodeAnalysis.Diagnostics;
using Microsoft.CodeAnalysis.Testing;
using Microsoft.CodeAnalysis.Testing.Verifiers;
using Microsoft.CodeAnalysis.Text;
namespace Godot.SourceGenerators.Tests;
public static class CSharpAnalyzerVerifier<TAnalyzer>
where TAnalyzer : DiagnosticAnalyzer, new()
{
public const LanguageVersion LangVersion = LanguageVersion.CSharp11;
public class Test : CSharpAnalyzerTest<TAnalyzer, XUnitVerifier>
{
public Test()
{
ReferenceAssemblies = Constants.Net80;
SolutionTransforms.Add((Solution solution, ProjectId projectId) =>
{
Project project =
solution.GetProject(projectId)!.AddMetadataReference(Constants.GodotSharpAssembly
.CreateMetadataReference()).WithParseOptions(new CSharpParseOptions(LangVersion));
return project.Solution;
});
}
}
public static Task Verify(string sources, params DiagnosticResult[] expected)
{
return MakeVerifier(new string[] { sources }, expected).RunAsync();
}
public static Test MakeVerifier(ICollection<string> sources, params DiagnosticResult[] expected)
{
var verifier = new Test();
verifier.TestState.AnalyzerConfigFiles.Add(("/.globalconfig", $"""
is_global = true
build_property.GodotProjectDir = {Constants.ExecutingAssemblyPath}
"""));
verifier.TestState.Sources.AddRange(sources.Select(source =>
{
return (source, SourceText.From(File.ReadAllText(Path.Combine(Constants.SourceFolderPath, source))));
}));
verifier.ExpectedDiagnostics.AddRange(expected);
return verifier;
}
}

View File

@@ -0,0 +1,48 @@
using System.IO;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CodeFixes;
using Microsoft.CodeAnalysis.CSharp.Testing;
using Microsoft.CodeAnalysis.Diagnostics;
using Microsoft.CodeAnalysis.Testing.Verifiers;
namespace Godot.SourceGenerators.Tests;
public static class CSharpCodeFixVerifier<TCodeFix, TAnalyzer>
where TCodeFix : CodeFixProvider, new()
where TAnalyzer : DiagnosticAnalyzer, new()
{
public class Test : CSharpCodeFixTest<TAnalyzer, TCodeFix, XUnitVerifier>
{
public Test()
{
ReferenceAssemblies = Constants.Net80;
SolutionTransforms.Add((Solution solution, ProjectId projectId) =>
{
Project project = solution.GetProject(projectId)!
.AddMetadataReference(Constants.GodotSharpAssembly.CreateMetadataReference());
return project.Solution;
});
}
}
public static Task Verify(string sources, string fixedSources)
{
return MakeVerifier(sources, fixedSources).RunAsync();
}
public static Test MakeVerifier(string source, string results)
{
var verifier = new Test();
verifier.TestCode = File.ReadAllText(Path.Combine(Constants.SourceFolderPath, source));
verifier.FixedCode = File.ReadAllText(Path.Combine(Constants.GeneratedSourceFolderPath, results));
verifier.TestState.AnalyzerConfigFiles.Add(("/.globalconfig", $"""
is_global = true
build_property.GodotProjectDir = {Constants.ExecutingAssemblyPath}
"""));
return verifier;
}
}

View File

@@ -0,0 +1,82 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp.Testing;
using Microsoft.CodeAnalysis.Testing;
using Microsoft.CodeAnalysis.Testing.Verifiers;
using Microsoft.CodeAnalysis.Text;
namespace Godot.SourceGenerators.Tests;
public static class CSharpSourceGeneratorVerifier<TSourceGenerator>
where TSourceGenerator : ISourceGenerator, new()
{
public class Test : CSharpSourceGeneratorTest<TSourceGenerator, XUnitVerifier>
{
public Test()
{
ReferenceAssemblies = Constants.Net80;
SolutionTransforms.Add((Solution solution, ProjectId projectId) =>
{
Project project = solution.GetProject(projectId)!
.AddMetadataReference(Constants.GodotSharpAssembly.CreateMetadataReference());
return project.Solution;
});
}
}
public static Task Verify(string source, params string[] generatedSources)
{
return Verify(new string[] { source }, generatedSources);
}
public static Task VerifyNoCompilerDiagnostics(string source, params string[] generatedSources)
{
return VerifyNoCompilerDiagnostics(new string[] { source }, generatedSources);
}
public static Task Verify(ICollection<string> sources, params string[] generatedSources)
{
return MakeVerifier(sources, generatedSources).RunAsync();
}
public static Task VerifyNoCompilerDiagnostics(ICollection<string> sources, params string[] generatedSources)
{
var verifier = MakeVerifier(sources, generatedSources);
verifier.CompilerDiagnostics = CompilerDiagnostics.None;
return verifier.RunAsync();
}
public static Test MakeVerifier(ICollection<string> sources, ICollection<string> generatedSources)
{
var verifier = new Test();
verifier.TestState.AnalyzerConfigFiles.Add(("/.globalconfig", $"""
is_global = true
build_property.GodotProjectDir = {Constants.ExecutingAssemblyPath}
"""));
verifier.TestState.Sources.AddRange(sources.Select(source => (
source,
SourceText.From(File.ReadAllText(Path.Combine(Constants.SourceFolderPath, source)))
)));
verifier.TestState.GeneratedSources.AddRange(generatedSources.Select(generatedSource => (
FullGeneratedSourceName(generatedSource),
SourceText.From(File.ReadAllText(Path.Combine(Constants.GeneratedSourceFolderPath, generatedSource)), Encoding.UTF8)
)));
return verifier;
}
private static string FullGeneratedSourceName(string name)
{
var generatorType = typeof(TSourceGenerator);
return Path.Combine(generatorType.Namespace!, generatorType.FullName!, name);
}
}

View File

@@ -0,0 +1,20 @@
using System.Threading.Tasks;
using Xunit;
namespace Godot.SourceGenerators.Tests;
public class ClassPartialModifierTest
{
[Fact]
public async Task ClassPartialModifierCodeFixTest()
{
await CSharpCodeFixVerifier<ClassPartialModifierCodeFixProvider, ClassPartialModifierAnalyzer>
.Verify("ClassPartialModifier.GD0001.cs", "ClassPartialModifier.GD0001.fixed.cs");
}
[Fact]
public async void OuterClassPartialModifierAnalyzerTest()
{
await CSharpAnalyzerVerifier<ClassPartialModifierAnalyzer>.Verify("OuterClassPartialModifierAnalyzer.GD0002.cs");
}
}

View File

@@ -0,0 +1,31 @@
using System.IO;
using System.Reflection;
using Microsoft.CodeAnalysis.Testing;
namespace Godot.SourceGenerators.Tests;
public static class Constants
{
public static Assembly GodotSharpAssembly => typeof(GodotObject).Assembly;
// Can't find what needs updating to be able to access ReferenceAssemblies.Net.Net80, so we're making our own one.
public static ReferenceAssemblies Net80 => new ReferenceAssemblies(
"net8.0",
new PackageIdentity("Microsoft.NETCore.App.Ref", "8.0.0"),
Path.Combine("ref", "net8.0")
);
public static string ExecutingAssemblyPath { get; }
public static string SourceFolderPath { get; }
public static string GeneratedSourceFolderPath { get; }
static Constants()
{
ExecutingAssemblyPath = Path.GetFullPath(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location!)!);
var testDataPath = Path.Combine(ExecutingAssemblyPath, "TestData");
SourceFolderPath = Path.Combine(testDataPath, "Sources");
GeneratedSourceFolderPath = Path.Combine(testDataPath, "GeneratedSources");
}
}

View File

@@ -0,0 +1,113 @@
using Xunit;
namespace Godot.SourceGenerators.Tests;
public class ExportDiagnosticsTests
{
[Fact]
public async void StaticMembers()
{
await CSharpSourceGeneratorVerifier<ScriptPropertyDefValGenerator>.Verify(
"ExportDiagnostics_GD0101.cs",
"ExportDiagnostics_GD0101_ScriptPropertyDefVal.generated.cs"
);
}
[Fact]
public async void TypeIsNotSupported()
{
await CSharpSourceGeneratorVerifier<ScriptPropertyDefValGenerator>.Verify(
"ExportDiagnostics_GD0102.cs",
"ExportDiagnostics_GD0102_ScriptPropertyDefVal.generated.cs"
);
}
[Fact]
public async void ReadOnly()
{
await CSharpSourceGeneratorVerifier<ScriptPropertyDefValGenerator>.Verify(
"ExportDiagnostics_GD0103.cs",
"ExportDiagnostics_GD0103_ScriptPropertyDefVal.generated.cs"
);
}
[Fact]
public async void WriteOnly()
{
await CSharpSourceGeneratorVerifier<ScriptPropertyDefValGenerator>.Verify(
"ExportDiagnostics_GD0104.cs",
"ExportDiagnostics_GD0104_ScriptPropertyDefVal.generated.cs"
);
}
[Fact]
public async void Indexer()
{
await CSharpSourceGeneratorVerifier<ScriptPropertyDefValGenerator>.Verify(
"ExportDiagnostics_GD0105.cs",
"ExportDiagnostics_GD0105_ScriptPropertyDefVal.generated.cs"
);
}
[Fact]
public async void ExplicitInterfaceImplementation()
{
await CSharpSourceGeneratorVerifier<ScriptPropertyDefValGenerator>.Verify(
new string[] { "ExportDiagnostics_GD0106.cs" },
new string[]
{
"ExportDiagnostics_GD0106_OK_ScriptPropertyDefVal.generated.cs",
"ExportDiagnostics_GD0106_KO_ScriptPropertyDefVal.generated.cs",
}
);
}
[Fact]
public async void NodeExports()
{
await CSharpSourceGeneratorVerifier<ScriptPropertyDefValGenerator>.Verify(
new string[] { "ExportDiagnostics_GD0107.cs" },
new string[]
{
"ExportDiagnostics_GD0107_OK_ScriptPropertyDefVal.generated.cs",
"ExportDiagnostics_GD0107_KO_ScriptPropertyDefVal.generated.cs",
}
);
}
[Fact]
public async void ExportToolButtonInNonToolClass()
{
await CSharpSourceGeneratorVerifier<ScriptPropertiesGenerator>.Verify(
new string[] { "ExportDiagnostics_GD0108.cs" },
new string[] { "ExportDiagnostics_GD0108_ScriptProperties.generated.cs" }
);
}
[Fact]
public async void ExportAndExportToolButtonOnSameMember()
{
await CSharpSourceGeneratorVerifier<ScriptPropertiesGenerator>.Verify(
new string[] { "ExportDiagnostics_GD0109.cs" },
new string[] { "ExportDiagnostics_GD0109_ScriptProperties.generated.cs" }
);
}
[Fact]
public async void ExportToolButtonOnNonCallable()
{
await CSharpSourceGeneratorVerifier<ScriptPropertiesGenerator>.Verify(
new string[] { "ExportDiagnostics_GD0110.cs" },
new string[] { "ExportDiagnostics_GD0110_ScriptProperties.generated.cs" }
);
}
[Fact]
public async void ExportToolButtonStoringCallable()
{
await CSharpSourceGeneratorVerifier<ScriptPropertiesGenerator>.Verify(
new string[] { "ExportDiagnostics_GD0111.cs" },
new string[] { "ExportDiagnostics_GD0111_ScriptProperties.generated.cs" }
);
}
}

View File

@@ -0,0 +1,12 @@
using System.Reflection;
using Microsoft.CodeAnalysis;
namespace Godot.SourceGenerators.Tests;
public static class Extensions
{
public static MetadataReference CreateMetadataReference(this Assembly assembly)
{
return MetadataReference.CreateFromFile(assembly.Location);
}
}

View File

@@ -0,0 +1,20 @@
using Xunit;
namespace Godot.SourceGenerators.Tests;
public class GlobalClassAnalyzerTests
{
[Fact]
public async void GlobalClassMustDeriveFromGodotObjectTest()
{
const string GlobalClassGD0401 = "GlobalClass.GD0401.cs";
await CSharpAnalyzerVerifier<GlobalClassAnalyzer>.Verify(GlobalClassGD0401);
}
[Fact]
public async void GlobalClassMustNotBeGenericTest()
{
const string GlobalClassGD0402 = "GlobalClass.GD0402.cs";
await CSharpAnalyzerVerifier<GlobalClassAnalyzer>.Verify(GlobalClassGD0402);
}
}

View File

@@ -0,0 +1,44 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>12</LangVersion>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>
<PropertyGroup>
<DefaultItemExcludesInProjectFolder>$(DefaultItemExcludesInProjectFolder);TestData\**</DefaultItemExcludesInProjectFolder>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.CodeFix.Testing" Version="1.1.1" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.CodeFix.Testing.XUnit" Version="1.1.1" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.8.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.SourceGenerators.Testing.XUnit" Version="1.1.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.1" />
<PackageReference Include="Microsoft.CodeAnalysis.Testing.Verifiers.XUnit" Version="1.1.1" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Analyzer.Testing.XUnit" Version="1.1.1" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="3.2.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\glue\GodotSharp\GodotSharp\GodotSharp.csproj" />
<ProjectReference Include="..\Godot.SourceGenerators\Godot.SourceGenerators.csproj" />
</ItemGroup>
<ItemGroup>
<None Include="TestData\**\*.cs" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,15 @@
using Xunit;
namespace Godot.SourceGenerators.Tests;
public class KeywordClassAndNamespaceTest
{
[Fact]
public async void GenerateScriptMethodsTest()
{
await CSharpSourceGeneratorVerifier<ScriptMethodsGenerator>.Verify(
"KeywordClassNameAndNamespace.cs",
"namespace.class_ScriptMethods.generated.cs"
);
}
}

View File

@@ -0,0 +1,20 @@
using Xunit;
namespace Godot.SourceGenerators.Tests;
public class MustBeVariantAnalyzerTests
{
[Fact]
public async void GenericTypeArgumentMustBeVariantTest()
{
const string MustBeVariantGD0301 = "MustBeVariant.GD0301.cs";
await CSharpAnalyzerVerifier<MustBeVariantAnalyzer>.Verify(MustBeVariantGD0301);
}
[Fact]
public async void GenericTypeParameterMustBeVariantAnnotatedTest()
{
const string MustBeVariantGD0302 = "MustBeVariant.GD0302.cs";
await CSharpAnalyzerVerifier<MustBeVariantAnalyzer>.Verify(MustBeVariantGD0302);
}
}

View File

@@ -0,0 +1,15 @@
using Xunit;
namespace Godot.SourceGenerators.Tests;
public class NestedInGenericTest
{
[Fact]
public async void GenerateScriptMethodsTest()
{
await CSharpSourceGeneratorVerifier<ScriptMethodsGenerator>.Verify(
"NestedInGeneric.cs",
"GenericClass(Of T).NestedClass_ScriptMethods.generated.cs"
);
}
}

View File

@@ -0,0 +1,24 @@
using Xunit;
namespace Godot.SourceGenerators.Tests;
public class ScriptMethodsGeneratorTests
{
[Fact]
public async void Methods()
{
await CSharpSourceGeneratorVerifier<ScriptMethodsGenerator>.Verify(
"Methods.cs",
"Methods_ScriptMethods.generated.cs"
);
}
[Fact]
public async void ScriptBoilerplate()
{
await CSharpSourceGeneratorVerifier<ScriptMethodsGenerator>.Verify(
"ScriptBoilerplate.cs",
"ScriptBoilerplate_ScriptMethods.generated.cs", "OuterClass.NestedClass_ScriptMethods.generated.cs"
);
}
}

View File

@@ -0,0 +1,80 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using Microsoft.CodeAnalysis.Text;
using Xunit;
namespace Godot.SourceGenerators.Tests;
public class ScriptPathAttributeGeneratorTests
{
private static (string, SourceText) MakeAssemblyScriptTypesGeneratedSource(ICollection<string> types)
{
return (
Path.Combine("Godot.SourceGenerators", "Godot.SourceGenerators.ScriptPathAttributeGenerator", "AssemblyScriptTypes.generated.cs"),
SourceText.From($$"""
[assembly:Godot.AssemblyHasScriptsAttribute(new System.Type[] {{{string.Join(", ", types.Select(type => $"typeof({type})"))}}})]
""", Encoding.UTF8)
);
}
[Fact]
public async void ScriptBoilerplate()
{
var verifier = CSharpSourceGeneratorVerifier<ScriptPathAttributeGenerator>.MakeVerifier(
new string[] { "ScriptBoilerplate.cs" },
new string[] { "ScriptBoilerplate_ScriptPath.generated.cs" }
);
verifier.TestState.GeneratedSources.Add(MakeAssemblyScriptTypesGeneratedSource(new string[] { "global::ScriptBoilerplate" }));
await verifier.RunAsync();
}
[Fact]
public async void FooBar()
{
var verifier = CSharpSourceGeneratorVerifier<ScriptPathAttributeGenerator>.MakeVerifier(
new string[] { "Foo.cs", "Bar.cs" },
new string[] { "Foo_ScriptPath.generated.cs", "Bar_ScriptPath.generated.cs" }
);
verifier.TestState.GeneratedSources.Add(MakeAssemblyScriptTypesGeneratedSource(new string[] { "global::Foo", "global::Bar" }));
await verifier.RunAsync();
}
[Fact]
public async void Generic()
{
var verifier = CSharpSourceGeneratorVerifier<ScriptPathAttributeGenerator>.MakeVerifier(
new string[] { "Generic.cs" },
new string[] { "Generic(Of T)_ScriptPath.generated.cs" }
);
verifier.TestState.GeneratedSources.Add(MakeAssemblyScriptTypesGeneratedSource(new string[] { "global::Generic<>" }));
await verifier.RunAsync();
}
[Fact]
public async void GenericMultipleClassesSameName()
{
var verifier = CSharpSourceGeneratorVerifier<ScriptPathAttributeGenerator>.MakeVerifier(
Array.Empty<string>(),
new string[] { "Generic(Of T)_ScriptPath.generated.cs" }
);
verifier.TestState.Sources.Add(("Generic.cs", File.ReadAllText(Path.Combine(Constants.SourceFolderPath, "Generic.GD0003.cs"))));
verifier.TestState.GeneratedSources.Add(MakeAssemblyScriptTypesGeneratedSource(new string[] { "global::Generic<>", "global::Generic<,>", "global::Generic" }));
await verifier.RunAsync();
}
[Fact]
public async void NamespaceMultipleClassesSameName()
{
var verifier = CSharpSourceGeneratorVerifier<ScriptPathAttributeGenerator>.MakeVerifier(
Array.Empty<string>(),
new string[] { "NamespaceA.SameName_ScriptPath.generated.cs" }
);
verifier.TestState.Sources.Add(("SameName.cs", File.ReadAllText(Path.Combine(Constants.SourceFolderPath, "SameName.GD0003.cs"))));
verifier.TestState.GeneratedSources.Add(MakeAssemblyScriptTypesGeneratedSource(new string[] { "global::NamespaceA.SameName", "global::NamespaceB.SameName" }));
await verifier.RunAsync();
}
}

View File

@@ -0,0 +1,78 @@
using Xunit;
namespace Godot.SourceGenerators.Tests;
public class ScriptPropertiesGeneratorTests
{
[Fact]
public async void ExportedFields()
{
await CSharpSourceGeneratorVerifier<ScriptPropertiesGenerator>.Verify(
new string[] { "ExportedFields.cs", "MoreExportedFields.cs" },
new string[] { "ExportedFields_ScriptProperties.generated.cs" }
);
}
[Fact]
public async void ExportedProperties()
{
await CSharpSourceGeneratorVerifier<ScriptPropertiesGenerator>.Verify(
"ExportedProperties.cs",
"ExportedProperties_ScriptProperties.generated.cs"
);
}
[Fact]
public async void OneWayPropertiesAllReadOnly()
{
await CSharpSourceGeneratorVerifier<ScriptPropertiesGenerator>.Verify(
"AllReadOnly.cs",
"AllReadOnly_ScriptProperties.generated.cs"
);
}
[Fact]
public async void OneWayPropertiesAllWriteOnly()
{
await CSharpSourceGeneratorVerifier<ScriptPropertiesGenerator>.Verify(
"AllWriteOnly.cs",
"AllWriteOnly_ScriptProperties.generated.cs"
);
}
[Fact]
public async void OneWayPropertiesMixedReadOnlyWriteOnly()
{
await CSharpSourceGeneratorVerifier<ScriptPropertiesGenerator>.Verify(
"MixedReadOnlyWriteOnly.cs",
"MixedReadOnlyWriteOnly_ScriptProperties.generated.cs"
);
}
[Fact]
public async void ScriptBoilerplate()
{
await CSharpSourceGeneratorVerifier<ScriptPropertiesGenerator>.Verify(
"ScriptBoilerplate.cs",
"ScriptBoilerplate_ScriptProperties.generated.cs", "OuterClass.NestedClass_ScriptProperties.generated.cs"
);
}
[Fact]
public async void AbstractGenericNode()
{
await CSharpSourceGeneratorVerifier<ScriptPropertiesGenerator>.Verify(
"AbstractGenericNode.cs",
"AbstractGenericNode(Of T)_ScriptProperties.generated.cs"
);
}
[Fact]
public async void ExportedButtons()
{
await CSharpSourceGeneratorVerifier<ScriptPropertiesGenerator>.Verify(
"ExportedToolButtons.cs",
"ExportedToolButtons_ScriptProperties.generated.cs"
);
}
}

View File

@@ -0,0 +1,40 @@
using Xunit;
namespace Godot.SourceGenerators.Tests;
public class ScriptPropertyDefValGeneratorTests
{
[Fact]
public async void ExportedFields()
{
await CSharpSourceGeneratorVerifier<ScriptPropertyDefValGenerator>.Verify(
new string[] { "ExportedFields.cs", "MoreExportedFields.cs" },
new string[] { "ExportedFields_ScriptPropertyDefVal.generated.cs" }
);
}
[Fact]
public async void ExportedProperties()
{
await CSharpSourceGeneratorVerifier<ScriptPropertyDefValGenerator>.Verify(
"ExportedProperties.cs",
"ExportedProperties_ScriptPropertyDefVal.generated.cs"
);
}
[Fact]
public async void ExportedProperties2()
{
await CSharpSourceGeneratorVerifier<ScriptPropertyDefValGenerator>.Verify(
"ExportedProperties2.cs", "ExportedProperties2_ScriptPropertyDefVal.generated.cs");
}
[Fact]
public async void ExportedComplexStrings()
{
await CSharpSourceGeneratorVerifier<ScriptPropertyDefValGenerator>.Verify(
"ExportedComplexStrings.cs",
"ExportedComplexStrings_ScriptPropertyDefVal.generated.cs"
);
}
}

View File

@@ -0,0 +1,15 @@
using Xunit;
namespace Godot.SourceGenerators.Tests;
public class ScriptSerializationGeneratorTests
{
[Fact]
public async void ScriptBoilerplate()
{
await CSharpSourceGeneratorVerifier<ScriptSerializationGenerator>.VerifyNoCompilerDiagnostics(
"ScriptBoilerplate.cs",
"ScriptBoilerplate_ScriptSerialization.generated.cs", "OuterClass.NestedClass_ScriptSerialization.generated.cs"
);
}
}

View File

@@ -0,0 +1,15 @@
using Xunit;
namespace Godot.SourceGenerators.Tests;
public class ScriptSignalsGeneratorTests
{
[Fact]
public async void EventSignals()
{
await CSharpSourceGeneratorVerifier<ScriptSignalsGenerator>.Verify(
"EventSignals.cs",
"EventSignals_ScriptSignals.generated.cs"
);
}
}

View File

@@ -0,0 +1,5 @@
root = true
[*.cs]
exclude = true
generated_code = true

View File

@@ -0,0 +1,49 @@
using Godot;
using Godot.NativeInterop;
partial class AbstractGenericNode<T>
{
#pragma warning disable CS0109 // Disable warning about redundant 'new' keyword
/// <summary>
/// Cached StringNames for the properties and fields contained in this class, for fast lookup.
/// </summary>
public new class PropertyName : global::Godot.Node.PropertyName {
/// <summary>
/// Cached name for the 'MyArray' property.
/// </summary>
public new static readonly global::Godot.StringName @MyArray = "MyArray";
}
/// <inheritdoc/>
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
protected override bool SetGodotClassPropertyValue(in godot_string_name name, in godot_variant value)
{
if (name == PropertyName.@MyArray) {
this.@MyArray = global::Godot.NativeInterop.VariantUtils.ConvertToArray<T>(value);
return true;
}
return base.SetGodotClassPropertyValue(name, value);
}
/// <inheritdoc/>
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
protected override bool GetGodotClassPropertyValue(in godot_string_name name, out godot_variant value)
{
if (name == PropertyName.@MyArray) {
value = global::Godot.NativeInterop.VariantUtils.CreateFromArray(this.@MyArray);
return true;
}
return base.GetGodotClassPropertyValue(name, out value);
}
/// <summary>
/// Get the property information for all the properties declared in this class.
/// This method is used by Godot to register the available properties in the editor.
/// Do not call this method.
/// </summary>
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
internal new static global::System.Collections.Generic.List<global::Godot.Bridge.PropertyInfo> GetGodotPropertyList()
{
var properties = new global::System.Collections.Generic.List<global::Godot.Bridge.PropertyInfo>();
properties.Add(new(type: (global::Godot.Variant.Type)28, name: PropertyName.@MyArray, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
return properties;
}
#pragma warning restore CS0109
}

View File

@@ -0,0 +1,66 @@
using Godot;
using Godot.NativeInterop;
partial class AllReadOnly
{
#pragma warning disable CS0109 // Disable warning about redundant 'new' keyword
/// <summary>
/// Cached StringNames for the properties and fields contained in this class, for fast lookup.
/// </summary>
public new class PropertyName : global::Godot.GodotObject.PropertyName {
/// <summary>
/// Cached name for the 'ReadOnlyAutoProperty' property.
/// </summary>
public new static readonly global::Godot.StringName @ReadOnlyAutoProperty = "ReadOnlyAutoProperty";
/// <summary>
/// Cached name for the 'ReadOnlyProperty' property.
/// </summary>
public new static readonly global::Godot.StringName @ReadOnlyProperty = "ReadOnlyProperty";
/// <summary>
/// Cached name for the 'InitOnlyAutoProperty' property.
/// </summary>
public new static readonly global::Godot.StringName @InitOnlyAutoProperty = "InitOnlyAutoProperty";
/// <summary>
/// Cached name for the 'ReadOnlyField' field.
/// </summary>
public new static readonly global::Godot.StringName @ReadOnlyField = "ReadOnlyField";
}
/// <inheritdoc/>
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
protected override bool GetGodotClassPropertyValue(in godot_string_name name, out godot_variant value)
{
if (name == PropertyName.@ReadOnlyAutoProperty) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string>(this.@ReadOnlyAutoProperty);
return true;
}
if (name == PropertyName.@ReadOnlyProperty) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string>(this.@ReadOnlyProperty);
return true;
}
if (name == PropertyName.@InitOnlyAutoProperty) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string>(this.@InitOnlyAutoProperty);
return true;
}
if (name == PropertyName.@ReadOnlyField) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string>(this.@ReadOnlyField);
return true;
}
return base.GetGodotClassPropertyValue(name, out value);
}
/// <summary>
/// Get the property information for all the properties declared in this class.
/// This method is used by Godot to register the available properties in the editor.
/// Do not call this method.
/// </summary>
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
internal new static global::System.Collections.Generic.List<global::Godot.Bridge.PropertyInfo> GetGodotPropertyList()
{
var properties = new global::System.Collections.Generic.List<global::Godot.Bridge.PropertyInfo>();
properties.Add(new(type: (global::Godot.Variant.Type)4, name: PropertyName.@ReadOnlyField, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4096, exported: false));
properties.Add(new(type: (global::Godot.Variant.Type)4, name: PropertyName.@ReadOnlyAutoProperty, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4096, exported: false));
properties.Add(new(type: (global::Godot.Variant.Type)4, name: PropertyName.@ReadOnlyProperty, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4096, exported: false));
properties.Add(new(type: (global::Godot.Variant.Type)4, name: PropertyName.@InitOnlyAutoProperty, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4096, exported: false));
return properties;
}
#pragma warning restore CS0109
}

View File

@@ -0,0 +1,58 @@
using Godot;
using Godot.NativeInterop;
partial class AllWriteOnly
{
#pragma warning disable CS0109 // Disable warning about redundant 'new' keyword
/// <summary>
/// Cached StringNames for the properties and fields contained in this class, for fast lookup.
/// </summary>
public new class PropertyName : global::Godot.GodotObject.PropertyName {
/// <summary>
/// Cached name for the 'WriteOnlyProperty' property.
/// </summary>
public new static readonly global::Godot.StringName @WriteOnlyProperty = "WriteOnlyProperty";
/// <summary>
/// Cached name for the '_writeOnlyBackingField' field.
/// </summary>
public new static readonly global::Godot.StringName @_writeOnlyBackingField = "_writeOnlyBackingField";
}
/// <inheritdoc/>
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
protected override bool SetGodotClassPropertyValue(in godot_string_name name, in godot_variant value)
{
if (name == PropertyName.@WriteOnlyProperty) {
this.@WriteOnlyProperty = global::Godot.NativeInterop.VariantUtils.ConvertTo<bool>(value);
return true;
}
if (name == PropertyName.@_writeOnlyBackingField) {
this.@_writeOnlyBackingField = global::Godot.NativeInterop.VariantUtils.ConvertTo<bool>(value);
return true;
}
return base.SetGodotClassPropertyValue(name, value);
}
/// <inheritdoc/>
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
protected override bool GetGodotClassPropertyValue(in godot_string_name name, out godot_variant value)
{
if (name == PropertyName.@_writeOnlyBackingField) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<bool>(this.@_writeOnlyBackingField);
return true;
}
return base.GetGodotClassPropertyValue(name, out value);
}
/// <summary>
/// Get the property information for all the properties declared in this class.
/// This method is used by Godot to register the available properties in the editor.
/// Do not call this method.
/// </summary>
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
internal new static global::System.Collections.Generic.List<global::Godot.Bridge.PropertyInfo> GetGodotPropertyList()
{
var properties = new global::System.Collections.Generic.List<global::Godot.Bridge.PropertyInfo>();
properties.Add(new(type: (global::Godot.Variant.Type)1, name: PropertyName.@_writeOnlyBackingField, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4096, exported: false));
properties.Add(new(type: (global::Godot.Variant.Type)1, name: PropertyName.@WriteOnlyProperty, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4096, exported: false));
return properties;
}
#pragma warning restore CS0109
}

View File

@@ -0,0 +1,5 @@
using Godot;
[ScriptPathAttribute("res://Bar.cs")]
partial class Bar
{
}

View File

@@ -0,0 +1,6 @@
using Godot;
public partial class ClassPartialModifier : Node
{
}

View File

@@ -0,0 +1,58 @@
using Godot;
using Godot.NativeInterop;
partial class EventSignals
{
#pragma warning disable CS0109 // Disable warning about redundant 'new' keyword
/// <summary>
/// Cached StringNames for the signals contained in this class, for fast lookup.
/// </summary>
public new class SignalName : global::Godot.GodotObject.SignalName {
/// <summary>
/// Cached name for the 'MySignal' signal.
/// </summary>
public new static readonly global::Godot.StringName @MySignal = "MySignal";
}
/// <summary>
/// Get the signal information for all the signals declared in this class.
/// This method is used by Godot to register the available signals in the editor.
/// Do not call this method.
/// </summary>
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
internal new static global::System.Collections.Generic.List<global::Godot.Bridge.MethodInfo> GetGodotSignalList()
{
var signals = new global::System.Collections.Generic.List<global::Godot.Bridge.MethodInfo>(1);
signals.Add(new(name: SignalName.@MySignal, returnVal: new(type: (global::Godot.Variant.Type)0, name: "", hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)6, exported: false), flags: (global::Godot.MethodFlags)1, arguments: new() { new(type: (global::Godot.Variant.Type)4, name: "str", hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)6, exported: false), new(type: (global::Godot.Variant.Type)2, name: "num", hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)6, exported: false), }, defaultArguments: null));
return signals;
}
#pragma warning restore CS0109
private global::EventSignals.MySignalEventHandler backing_MySignal;
/// <inheritdoc cref="global::EventSignals.MySignalEventHandler"/>
public event global::EventSignals.MySignalEventHandler @MySignal {
add => backing_MySignal += value;
remove => backing_MySignal -= value;
}
protected void EmitSignalMySignal(string @str, int @num)
{
EmitSignal(SignalName.MySignal, @str, @num);
}
/// <inheritdoc/>
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
protected override void RaiseGodotClassSignalCallbacks(in godot_string_name signal, NativeVariantPtrArgs args)
{
if (signal == SignalName.@MySignal && args.Count == 2) {
backing_MySignal?.Invoke(global::Godot.NativeInterop.VariantUtils.ConvertTo<string>(args[0]), global::Godot.NativeInterop.VariantUtils.ConvertTo<int>(args[1]));
return;
}
base.RaiseGodotClassSignalCallbacks(signal, args);
}
/// <inheritdoc/>
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
protected override bool HasGodotClassSignal(in godot_string_name signal)
{
if (signal == SignalName.@MySignal) {
return true;
}
return base.HasGodotClassSignal(signal);
}
}

View File

@@ -0,0 +1,21 @@
partial class ExportDiagnostics_GD0106_OK
{
#pragma warning disable CS0109 // Disable warning about redundant 'new' keyword
#if TOOLS
/// <summary>
/// Get the default values for all properties declared in this class.
/// This method is used by Godot to determine the value that will be
/// used by the inspector when resetting properties.
/// Do not call this method.
/// </summary>
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
internal new static global::System.Collections.Generic.Dictionary<global::Godot.StringName, global::Godot.Variant> GetGodotPropertyDefaultValues()
{
var values = new global::System.Collections.Generic.Dictionary<global::Godot.StringName, global::Godot.Variant>(1);
int __MyProperty_default_value = default;
values.Add(PropertyName.@MyProperty, global::Godot.Variant.From<int>(__MyProperty_default_value));
return values;
}
#endif // TOOLS
#pragma warning restore CS0109
}

View File

@@ -0,0 +1,39 @@
partial class ExportDiagnostics_GD0107_OK
{
#pragma warning disable CS0109 // Disable warning about redundant 'new' keyword
#if TOOLS
/// <summary>
/// Get the default values for all properties declared in this class.
/// This method is used by Godot to determine the value that will be
/// used by the inspector when resetting properties.
/// Do not call this method.
/// </summary>
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
internal new static global::System.Collections.Generic.Dictionary<global::Godot.StringName, global::Godot.Variant> GetGodotPropertyDefaultValues()
{
var values = new global::System.Collections.Generic.Dictionary<global::Godot.StringName, global::Godot.Variant>(10);
global::Godot.Node __NodeProperty_default_value = default;
values.Add(PropertyName.@NodeProperty, global::Godot.Variant.From<global::Godot.Node>(__NodeProperty_default_value));
global::Godot.Node[] __SystemArrayOfNodesProperty_default_value = default;
values.Add(PropertyName.@SystemArrayOfNodesProperty, global::Godot.Variant.CreateFrom(__SystemArrayOfNodesProperty_default_value));
global::Godot.Collections.Array<global::Godot.Node> __GodotArrayOfNodesProperty_default_value = default;
values.Add(PropertyName.@GodotArrayOfNodesProperty, global::Godot.Variant.CreateFrom(__GodotArrayOfNodesProperty_default_value));
global::Godot.Collections.Dictionary<global::Godot.Node, string> __GodotDictionaryWithNodeAsKeyProperty_default_value = default;
values.Add(PropertyName.@GodotDictionaryWithNodeAsKeyProperty, global::Godot.Variant.CreateFrom(__GodotDictionaryWithNodeAsKeyProperty_default_value));
global::Godot.Collections.Dictionary<string, global::Godot.Node> __GodotDictionaryWithNodeAsValueProperty_default_value = default;
values.Add(PropertyName.@GodotDictionaryWithNodeAsValueProperty, global::Godot.Variant.CreateFrom(__GodotDictionaryWithNodeAsValueProperty_default_value));
global::Godot.Node __NodeField_default_value = default;
values.Add(PropertyName.@NodeField, global::Godot.Variant.From<global::Godot.Node>(__NodeField_default_value));
global::Godot.Node[] __SystemArrayOfNodesField_default_value = default;
values.Add(PropertyName.@SystemArrayOfNodesField, global::Godot.Variant.CreateFrom(__SystemArrayOfNodesField_default_value));
global::Godot.Collections.Array<global::Godot.Node> __GodotArrayOfNodesField_default_value = default;
values.Add(PropertyName.@GodotArrayOfNodesField, global::Godot.Variant.CreateFrom(__GodotArrayOfNodesField_default_value));
global::Godot.Collections.Dictionary<global::Godot.Node, string> __GodotDictionaryWithNodeAsKeyField_default_value = default;
values.Add(PropertyName.@GodotDictionaryWithNodeAsKeyField, global::Godot.Variant.CreateFrom(__GodotDictionaryWithNodeAsKeyField_default_value));
global::Godot.Collections.Dictionary<string, global::Godot.Node> __GodotDictionaryWithNodeAsValueField_default_value = default;
values.Add(PropertyName.@GodotDictionaryWithNodeAsValueField, global::Godot.Variant.CreateFrom(__GodotDictionaryWithNodeAsValueField_default_value));
return values;
}
#endif // TOOLS
#pragma warning restore CS0109
}

View File

@@ -0,0 +1,38 @@
using Godot;
using Godot.NativeInterop;
partial class ExportDiagnostics_GD0108
{
#pragma warning disable CS0109 // Disable warning about redundant 'new' keyword
/// <summary>
/// Cached StringNames for the properties and fields contained in this class, for fast lookup.
/// </summary>
public new class PropertyName : global::Godot.Node.PropertyName {
/// <summary>
/// Cached name for the 'MyButton' property.
/// </summary>
public new static readonly global::Godot.StringName @MyButton = "MyButton";
}
/// <inheritdoc/>
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
protected override bool GetGodotClassPropertyValue(in godot_string_name name, out godot_variant value)
{
if (name == PropertyName.@MyButton) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Callable>(this.@MyButton);
return true;
}
return base.GetGodotClassPropertyValue(name, out value);
}
/// <summary>
/// Get the property information for all the properties declared in this class.
/// This method is used by Godot to register the available properties in the editor.
/// Do not call this method.
/// </summary>
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
internal new static global::System.Collections.Generic.List<global::Godot.Bridge.PropertyInfo> GetGodotPropertyList()
{
var properties = new global::System.Collections.Generic.List<global::Godot.Bridge.PropertyInfo>();
return properties;
}
#pragma warning restore CS0109
}

View File

@@ -0,0 +1,38 @@
using Godot;
using Godot.NativeInterop;
partial class ExportDiagnostics_GD0109
{
#pragma warning disable CS0109 // Disable warning about redundant 'new' keyword
/// <summary>
/// Cached StringNames for the properties and fields contained in this class, for fast lookup.
/// </summary>
public new class PropertyName : global::Godot.Node.PropertyName {
/// <summary>
/// Cached name for the 'MyButton' property.
/// </summary>
public new static readonly global::Godot.StringName @MyButton = "MyButton";
}
/// <inheritdoc/>
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
protected override bool GetGodotClassPropertyValue(in godot_string_name name, out godot_variant value)
{
if (name == PropertyName.@MyButton) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Callable>(this.@MyButton);
return true;
}
return base.GetGodotClassPropertyValue(name, out value);
}
/// <summary>
/// Get the property information for all the properties declared in this class.
/// This method is used by Godot to register the available properties in the editor.
/// Do not call this method.
/// </summary>
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
internal new static global::System.Collections.Generic.List<global::Godot.Bridge.PropertyInfo> GetGodotPropertyList()
{
var properties = new global::System.Collections.Generic.List<global::Godot.Bridge.PropertyInfo>();
return properties;
}
#pragma warning restore CS0109
}

View File

@@ -0,0 +1,38 @@
using Godot;
using Godot.NativeInterop;
partial class ExportDiagnostics_GD0110
{
#pragma warning disable CS0109 // Disable warning about redundant 'new' keyword
/// <summary>
/// Cached StringNames for the properties and fields contained in this class, for fast lookup.
/// </summary>
public new class PropertyName : global::Godot.Node.PropertyName {
/// <summary>
/// Cached name for the 'MyButton' property.
/// </summary>
public new static readonly global::Godot.StringName @MyButton = "MyButton";
}
/// <inheritdoc/>
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
protected override bool GetGodotClassPropertyValue(in godot_string_name name, out godot_variant value)
{
if (name == PropertyName.@MyButton) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<int>(this.@MyButton);
return true;
}
return base.GetGodotClassPropertyValue(name, out value);
}
/// <summary>
/// Get the property information for all the properties declared in this class.
/// This method is used by Godot to register the available properties in the editor.
/// Do not call this method.
/// </summary>
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
internal new static global::System.Collections.Generic.List<global::Godot.Bridge.PropertyInfo> GetGodotPropertyList()
{
var properties = new global::System.Collections.Generic.List<global::Godot.Bridge.PropertyInfo>();
return properties;
}
#pragma warning restore CS0109
}

View File

@@ -0,0 +1,116 @@
using Godot;
using Godot.NativeInterop;
partial class ExportDiagnostics_GD0111
{
#pragma warning disable CS0109 // Disable warning about redundant 'new' keyword
/// <summary>
/// Cached StringNames for the properties and fields contained in this class, for fast lookup.
/// </summary>
public new class PropertyName : global::Godot.Node.PropertyName {
/// <summary>
/// Cached name for the 'MyButtonGet' property.
/// </summary>
public new static readonly global::Godot.StringName @MyButtonGet = "MyButtonGet";
/// <summary>
/// Cached name for the 'MyButtonGetSet' property.
/// </summary>
public new static readonly global::Godot.StringName @MyButtonGetSet = "MyButtonGetSet";
/// <summary>
/// Cached name for the 'MyButtonGetWithBackingField' property.
/// </summary>
public new static readonly global::Godot.StringName @MyButtonGetWithBackingField = "MyButtonGetWithBackingField";
/// <summary>
/// Cached name for the 'MyButtonGetSetWithBackingField' property.
/// </summary>
public new static readonly global::Godot.StringName @MyButtonGetSetWithBackingField = "MyButtonGetSetWithBackingField";
/// <summary>
/// Cached name for the 'MyButtonOkWithCallableCreationExpression' property.
/// </summary>
public new static readonly global::Godot.StringName @MyButtonOkWithCallableCreationExpression = "MyButtonOkWithCallableCreationExpression";
/// <summary>
/// Cached name for the 'MyButtonOkWithImplicitCallableCreationExpression' property.
/// </summary>
public new static readonly global::Godot.StringName @MyButtonOkWithImplicitCallableCreationExpression = "MyButtonOkWithImplicitCallableCreationExpression";
/// <summary>
/// Cached name for the 'MyButtonOkWithCallableFromExpression' property.
/// </summary>
public new static readonly global::Godot.StringName @MyButtonOkWithCallableFromExpression = "MyButtonOkWithCallableFromExpression";
/// <summary>
/// Cached name for the '_backingField' field.
/// </summary>
public new static readonly global::Godot.StringName @_backingField = "_backingField";
}
/// <inheritdoc/>
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
protected override bool SetGodotClassPropertyValue(in godot_string_name name, in godot_variant value)
{
if (name == PropertyName.@MyButtonGetSet) {
this.@MyButtonGetSet = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Callable>(value);
return true;
}
if (name == PropertyName.@MyButtonGetSetWithBackingField) {
this.@MyButtonGetSetWithBackingField = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Callable>(value);
return true;
}
if (name == PropertyName.@_backingField) {
this.@_backingField = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Callable>(value);
return true;
}
return base.SetGodotClassPropertyValue(name, value);
}
/// <inheritdoc/>
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
protected override bool GetGodotClassPropertyValue(in godot_string_name name, out godot_variant value)
{
if (name == PropertyName.@MyButtonGet) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Callable>(this.@MyButtonGet);
return true;
}
if (name == PropertyName.@MyButtonGetSet) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Callable>(this.@MyButtonGetSet);
return true;
}
if (name == PropertyName.@MyButtonGetWithBackingField) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Callable>(this.@MyButtonGetWithBackingField);
return true;
}
if (name == PropertyName.@MyButtonGetSetWithBackingField) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Callable>(this.@MyButtonGetSetWithBackingField);
return true;
}
if (name == PropertyName.@MyButtonOkWithCallableCreationExpression) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Callable>(this.@MyButtonOkWithCallableCreationExpression);
return true;
}
if (name == PropertyName.@MyButtonOkWithImplicitCallableCreationExpression) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Callable>(this.@MyButtonOkWithImplicitCallableCreationExpression);
return true;
}
if (name == PropertyName.@MyButtonOkWithCallableFromExpression) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Callable>(this.@MyButtonOkWithCallableFromExpression);
return true;
}
if (name == PropertyName.@_backingField) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Callable>(this.@_backingField);
return true;
}
return base.GetGodotClassPropertyValue(name, out value);
}
/// <summary>
/// Get the property information for all the properties declared in this class.
/// This method is used by Godot to register the available properties in the editor.
/// Do not call this method.
/// </summary>
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
internal new static global::System.Collections.Generic.List<global::Godot.Bridge.PropertyInfo> GetGodotPropertyList()
{
var properties = new global::System.Collections.Generic.List<global::Godot.Bridge.PropertyInfo>();
properties.Add(new(type: (global::Godot.Variant.Type)25, name: PropertyName.@_backingField, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4096, exported: false));
properties.Add(new(type: (global::Godot.Variant.Type)25, name: PropertyName.@MyButtonOkWithCallableCreationExpression, hint: (global::Godot.PropertyHint)39, hintString: "", usage: (global::Godot.PropertyUsageFlags)4, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)25, name: PropertyName.@MyButtonOkWithImplicitCallableCreationExpression, hint: (global::Godot.PropertyHint)39, hintString: "", usage: (global::Godot.PropertyUsageFlags)4, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)25, name: PropertyName.@MyButtonOkWithCallableFromExpression, hint: (global::Godot.PropertyHint)39, hintString: "", usage: (global::Godot.PropertyUsageFlags)4, exported: true));
return properties;
}
#pragma warning restore CS0109
}

View File

@@ -0,0 +1,29 @@
partial class ExportedComplexStrings
{
#pragma warning disable CS0109 // Disable warning about redundant 'new' keyword
#if TOOLS
/// <summary>
/// Get the default values for all properties declared in this class.
/// This method is used by Godot to determine the value that will be
/// used by the inspector when resetting properties.
/// Do not call this method.
/// </summary>
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
internal new static global::System.Collections.Generic.Dictionary<global::Godot.StringName, global::Godot.Variant> GetGodotPropertyDefaultValues()
{
var values = new global::System.Collections.Generic.Dictionary<global::Godot.StringName, global::Godot.Variant>(5);
string __PropertyInterpolated1_default_value = $"The quick brown fox jumps over {(global::Godot.GD.VarToStr($"the lazy {(global::Godot.Engine.GetVersionInfo())} do"))}g.";
values.Add(PropertyName.@PropertyInterpolated1, global::Godot.Variant.From<string>(__PropertyInterpolated1_default_value));
string ___fieldInterpolated1_default_value = $"The quick brown fox jumps over ({(global::Godot.Engine.GetVersionInfo())})";
values.Add(PropertyName.@_fieldInterpolated1, global::Godot.Variant.From<string>(___fieldInterpolated1_default_value));
string ___fieldInterpolated2_default_value = $"The quick brown fox jumps over ({(global::Godot.Engine.GetVersionInfo()["major"]),0:G}) the lazy dog.";
values.Add(PropertyName.@_fieldInterpolated2, global::Godot.Variant.From<string>(___fieldInterpolated2_default_value));
string ___fieldInterpolated3_default_value = $"{(((int)global::Godot.Engine.GetVersionInfo()["major"]) * -1 * -1):G} the lazy dog.";
values.Add(PropertyName.@_fieldInterpolated3, global::Godot.Variant.From<string>(___fieldInterpolated3_default_value));
string ___fieldInterpolated4_default_value = $"{(":::fff,,}<,<}},,}]")}";
values.Add(PropertyName.@_fieldInterpolated4, global::Godot.Variant.From<string>(___fieldInterpolated4_default_value));
return values;
}
#endif // TOOLS
#pragma warning restore CS0109
}

View File

@@ -0,0 +1,816 @@
using Godot;
using Godot.NativeInterop;
partial class ExportedFields
{
#pragma warning disable CS0109 // Disable warning about redundant 'new' keyword
/// <summary>
/// Cached StringNames for the properties and fields contained in this class, for fast lookup.
/// </summary>
public new class PropertyName : global::Godot.GodotObject.PropertyName {
/// <summary>
/// Cached name for the '_fieldBoolean' field.
/// </summary>
public new static readonly global::Godot.StringName @_fieldBoolean = "_fieldBoolean";
/// <summary>
/// Cached name for the '_fieldChar' field.
/// </summary>
public new static readonly global::Godot.StringName @_fieldChar = "_fieldChar";
/// <summary>
/// Cached name for the '_fieldSByte' field.
/// </summary>
public new static readonly global::Godot.StringName @_fieldSByte = "_fieldSByte";
/// <summary>
/// Cached name for the '_fieldInt16' field.
/// </summary>
public new static readonly global::Godot.StringName @_fieldInt16 = "_fieldInt16";
/// <summary>
/// Cached name for the '_fieldInt32' field.
/// </summary>
public new static readonly global::Godot.StringName @_fieldInt32 = "_fieldInt32";
/// <summary>
/// Cached name for the '_fieldInt64' field.
/// </summary>
public new static readonly global::Godot.StringName @_fieldInt64 = "_fieldInt64";
/// <summary>
/// Cached name for the '_fieldByte' field.
/// </summary>
public new static readonly global::Godot.StringName @_fieldByte = "_fieldByte";
/// <summary>
/// Cached name for the '_fieldUInt16' field.
/// </summary>
public new static readonly global::Godot.StringName @_fieldUInt16 = "_fieldUInt16";
/// <summary>
/// Cached name for the '_fieldUInt32' field.
/// </summary>
public new static readonly global::Godot.StringName @_fieldUInt32 = "_fieldUInt32";
/// <summary>
/// Cached name for the '_fieldUInt64' field.
/// </summary>
public new static readonly global::Godot.StringName @_fieldUInt64 = "_fieldUInt64";
/// <summary>
/// Cached name for the '_fieldSingle' field.
/// </summary>
public new static readonly global::Godot.StringName @_fieldSingle = "_fieldSingle";
/// <summary>
/// Cached name for the '_fieldDouble' field.
/// </summary>
public new static readonly global::Godot.StringName @_fieldDouble = "_fieldDouble";
/// <summary>
/// Cached name for the '_fieldString' field.
/// </summary>
public new static readonly global::Godot.StringName @_fieldString = "_fieldString";
/// <summary>
/// Cached name for the '_fieldVector2' field.
/// </summary>
public new static readonly global::Godot.StringName @_fieldVector2 = "_fieldVector2";
/// <summary>
/// Cached name for the '_fieldVector2I' field.
/// </summary>
public new static readonly global::Godot.StringName @_fieldVector2I = "_fieldVector2I";
/// <summary>
/// Cached name for the '_fieldRect2' field.
/// </summary>
public new static readonly global::Godot.StringName @_fieldRect2 = "_fieldRect2";
/// <summary>
/// Cached name for the '_fieldRect2I' field.
/// </summary>
public new static readonly global::Godot.StringName @_fieldRect2I = "_fieldRect2I";
/// <summary>
/// Cached name for the '_fieldTransform2D' field.
/// </summary>
public new static readonly global::Godot.StringName @_fieldTransform2D = "_fieldTransform2D";
/// <summary>
/// Cached name for the '_fieldVector3' field.
/// </summary>
public new static readonly global::Godot.StringName @_fieldVector3 = "_fieldVector3";
/// <summary>
/// Cached name for the '_fieldVector3I' field.
/// </summary>
public new static readonly global::Godot.StringName @_fieldVector3I = "_fieldVector3I";
/// <summary>
/// Cached name for the '_fieldBasis' field.
/// </summary>
public new static readonly global::Godot.StringName @_fieldBasis = "_fieldBasis";
/// <summary>
/// Cached name for the '_fieldQuaternion' field.
/// </summary>
public new static readonly global::Godot.StringName @_fieldQuaternion = "_fieldQuaternion";
/// <summary>
/// Cached name for the '_fieldTransform3D' field.
/// </summary>
public new static readonly global::Godot.StringName @_fieldTransform3D = "_fieldTransform3D";
/// <summary>
/// Cached name for the '_fieldVector4' field.
/// </summary>
public new static readonly global::Godot.StringName @_fieldVector4 = "_fieldVector4";
/// <summary>
/// Cached name for the '_fieldVector4I' field.
/// </summary>
public new static readonly global::Godot.StringName @_fieldVector4I = "_fieldVector4I";
/// <summary>
/// Cached name for the '_fieldProjection' field.
/// </summary>
public new static readonly global::Godot.StringName @_fieldProjection = "_fieldProjection";
/// <summary>
/// Cached name for the '_fieldAabb' field.
/// </summary>
public new static readonly global::Godot.StringName @_fieldAabb = "_fieldAabb";
/// <summary>
/// Cached name for the '_fieldColor' field.
/// </summary>
public new static readonly global::Godot.StringName @_fieldColor = "_fieldColor";
/// <summary>
/// Cached name for the '_fieldPlane' field.
/// </summary>
public new static readonly global::Godot.StringName @_fieldPlane = "_fieldPlane";
/// <summary>
/// Cached name for the '_fieldCallable' field.
/// </summary>
public new static readonly global::Godot.StringName @_fieldCallable = "_fieldCallable";
/// <summary>
/// Cached name for the '_fieldSignal' field.
/// </summary>
public new static readonly global::Godot.StringName @_fieldSignal = "_fieldSignal";
/// <summary>
/// Cached name for the '_fieldEnum' field.
/// </summary>
public new static readonly global::Godot.StringName @_fieldEnum = "_fieldEnum";
/// <summary>
/// Cached name for the '_fieldFlagsEnum' field.
/// </summary>
public new static readonly global::Godot.StringName @_fieldFlagsEnum = "_fieldFlagsEnum";
/// <summary>
/// Cached name for the '_fieldByteArray' field.
/// </summary>
public new static readonly global::Godot.StringName @_fieldByteArray = "_fieldByteArray";
/// <summary>
/// Cached name for the '_fieldInt32Array' field.
/// </summary>
public new static readonly global::Godot.StringName @_fieldInt32Array = "_fieldInt32Array";
/// <summary>
/// Cached name for the '_fieldInt64Array' field.
/// </summary>
public new static readonly global::Godot.StringName @_fieldInt64Array = "_fieldInt64Array";
/// <summary>
/// Cached name for the '_fieldSingleArray' field.
/// </summary>
public new static readonly global::Godot.StringName @_fieldSingleArray = "_fieldSingleArray";
/// <summary>
/// Cached name for the '_fieldDoubleArray' field.
/// </summary>
public new static readonly global::Godot.StringName @_fieldDoubleArray = "_fieldDoubleArray";
/// <summary>
/// Cached name for the '_fieldStringArray' field.
/// </summary>
public new static readonly global::Godot.StringName @_fieldStringArray = "_fieldStringArray";
/// <summary>
/// Cached name for the '_fieldStringArrayEnum' field.
/// </summary>
public new static readonly global::Godot.StringName @_fieldStringArrayEnum = "_fieldStringArrayEnum";
/// <summary>
/// Cached name for the '_fieldVector2Array' field.
/// </summary>
public new static readonly global::Godot.StringName @_fieldVector2Array = "_fieldVector2Array";
/// <summary>
/// Cached name for the '_fieldVector3Array' field.
/// </summary>
public new static readonly global::Godot.StringName @_fieldVector3Array = "_fieldVector3Array";
/// <summary>
/// Cached name for the '_fieldColorArray' field.
/// </summary>
public new static readonly global::Godot.StringName @_fieldColorArray = "_fieldColorArray";
/// <summary>
/// Cached name for the '_fieldGodotObjectOrDerivedArray' field.
/// </summary>
public new static readonly global::Godot.StringName @_fieldGodotObjectOrDerivedArray = "_fieldGodotObjectOrDerivedArray";
/// <summary>
/// Cached name for the '_fieldStringNameArray' field.
/// </summary>
public new static readonly global::Godot.StringName @_fieldStringNameArray = "_fieldStringNameArray";
/// <summary>
/// Cached name for the '_fieldNodePathArray' field.
/// </summary>
public new static readonly global::Godot.StringName @_fieldNodePathArray = "_fieldNodePathArray";
/// <summary>
/// Cached name for the '_fieldRidArray' field.
/// </summary>
public new static readonly global::Godot.StringName @_fieldRidArray = "_fieldRidArray";
/// <summary>
/// Cached name for the '_fieldEmptyInt32Array' field.
/// </summary>
public new static readonly global::Godot.StringName @_fieldEmptyInt32Array = "_fieldEmptyInt32Array";
/// <summary>
/// Cached name for the '_fieldArrayFromList' field.
/// </summary>
public new static readonly global::Godot.StringName @_fieldArrayFromList = "_fieldArrayFromList";
/// <summary>
/// Cached name for the '_fieldVariant' field.
/// </summary>
public new static readonly global::Godot.StringName @_fieldVariant = "_fieldVariant";
/// <summary>
/// Cached name for the '_fieldGodotObjectOrDerived' field.
/// </summary>
public new static readonly global::Godot.StringName @_fieldGodotObjectOrDerived = "_fieldGodotObjectOrDerived";
/// <summary>
/// Cached name for the '_fieldGodotResourceTexture' field.
/// </summary>
public new static readonly global::Godot.StringName @_fieldGodotResourceTexture = "_fieldGodotResourceTexture";
/// <summary>
/// Cached name for the '_fieldStringName' field.
/// </summary>
public new static readonly global::Godot.StringName @_fieldStringName = "_fieldStringName";
/// <summary>
/// Cached name for the '_fieldNodePath' field.
/// </summary>
public new static readonly global::Godot.StringName @_fieldNodePath = "_fieldNodePath";
/// <summary>
/// Cached name for the '_fieldRid' field.
/// </summary>
public new static readonly global::Godot.StringName @_fieldRid = "_fieldRid";
/// <summary>
/// Cached name for the '_fieldGodotDictionary' field.
/// </summary>
public new static readonly global::Godot.StringName @_fieldGodotDictionary = "_fieldGodotDictionary";
/// <summary>
/// Cached name for the '_fieldGodotArray' field.
/// </summary>
public new static readonly global::Godot.StringName @_fieldGodotArray = "_fieldGodotArray";
/// <summary>
/// Cached name for the '_fieldGodotGenericDictionary' field.
/// </summary>
public new static readonly global::Godot.StringName @_fieldGodotGenericDictionary = "_fieldGodotGenericDictionary";
/// <summary>
/// Cached name for the '_fieldGodotGenericArray' field.
/// </summary>
public new static readonly global::Godot.StringName @_fieldGodotGenericArray = "_fieldGodotGenericArray";
/// <summary>
/// Cached name for the '_fieldEmptyInt64Array' field.
/// </summary>
public new static readonly global::Godot.StringName @_fieldEmptyInt64Array = "_fieldEmptyInt64Array";
}
/// <inheritdoc/>
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
protected override bool SetGodotClassPropertyValue(in godot_string_name name, in godot_variant value)
{
if (name == PropertyName.@_fieldBoolean) {
this.@_fieldBoolean = global::Godot.NativeInterop.VariantUtils.ConvertTo<bool>(value);
return true;
}
if (name == PropertyName.@_fieldChar) {
this.@_fieldChar = global::Godot.NativeInterop.VariantUtils.ConvertTo<char>(value);
return true;
}
if (name == PropertyName.@_fieldSByte) {
this.@_fieldSByte = global::Godot.NativeInterop.VariantUtils.ConvertTo<sbyte>(value);
return true;
}
if (name == PropertyName.@_fieldInt16) {
this.@_fieldInt16 = global::Godot.NativeInterop.VariantUtils.ConvertTo<short>(value);
return true;
}
if (name == PropertyName.@_fieldInt32) {
this.@_fieldInt32 = global::Godot.NativeInterop.VariantUtils.ConvertTo<int>(value);
return true;
}
if (name == PropertyName.@_fieldInt64) {
this.@_fieldInt64 = global::Godot.NativeInterop.VariantUtils.ConvertTo<long>(value);
return true;
}
if (name == PropertyName.@_fieldByte) {
this.@_fieldByte = global::Godot.NativeInterop.VariantUtils.ConvertTo<byte>(value);
return true;
}
if (name == PropertyName.@_fieldUInt16) {
this.@_fieldUInt16 = global::Godot.NativeInterop.VariantUtils.ConvertTo<ushort>(value);
return true;
}
if (name == PropertyName.@_fieldUInt32) {
this.@_fieldUInt32 = global::Godot.NativeInterop.VariantUtils.ConvertTo<uint>(value);
return true;
}
if (name == PropertyName.@_fieldUInt64) {
this.@_fieldUInt64 = global::Godot.NativeInterop.VariantUtils.ConvertTo<ulong>(value);
return true;
}
if (name == PropertyName.@_fieldSingle) {
this.@_fieldSingle = global::Godot.NativeInterop.VariantUtils.ConvertTo<float>(value);
return true;
}
if (name == PropertyName.@_fieldDouble) {
this.@_fieldDouble = global::Godot.NativeInterop.VariantUtils.ConvertTo<double>(value);
return true;
}
if (name == PropertyName.@_fieldString) {
this.@_fieldString = global::Godot.NativeInterop.VariantUtils.ConvertTo<string>(value);
return true;
}
if (name == PropertyName.@_fieldVector2) {
this.@_fieldVector2 = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Vector2>(value);
return true;
}
if (name == PropertyName.@_fieldVector2I) {
this.@_fieldVector2I = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Vector2I>(value);
return true;
}
if (name == PropertyName.@_fieldRect2) {
this.@_fieldRect2 = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Rect2>(value);
return true;
}
if (name == PropertyName.@_fieldRect2I) {
this.@_fieldRect2I = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Rect2I>(value);
return true;
}
if (name == PropertyName.@_fieldTransform2D) {
this.@_fieldTransform2D = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Transform2D>(value);
return true;
}
if (name == PropertyName.@_fieldVector3) {
this.@_fieldVector3 = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Vector3>(value);
return true;
}
if (name == PropertyName.@_fieldVector3I) {
this.@_fieldVector3I = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Vector3I>(value);
return true;
}
if (name == PropertyName.@_fieldBasis) {
this.@_fieldBasis = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Basis>(value);
return true;
}
if (name == PropertyName.@_fieldQuaternion) {
this.@_fieldQuaternion = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Quaternion>(value);
return true;
}
if (name == PropertyName.@_fieldTransform3D) {
this.@_fieldTransform3D = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Transform3D>(value);
return true;
}
if (name == PropertyName.@_fieldVector4) {
this.@_fieldVector4 = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Vector4>(value);
return true;
}
if (name == PropertyName.@_fieldVector4I) {
this.@_fieldVector4I = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Vector4I>(value);
return true;
}
if (name == PropertyName.@_fieldProjection) {
this.@_fieldProjection = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Projection>(value);
return true;
}
if (name == PropertyName.@_fieldAabb) {
this.@_fieldAabb = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Aabb>(value);
return true;
}
if (name == PropertyName.@_fieldColor) {
this.@_fieldColor = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Color>(value);
return true;
}
if (name == PropertyName.@_fieldPlane) {
this.@_fieldPlane = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Plane>(value);
return true;
}
if (name == PropertyName.@_fieldCallable) {
this.@_fieldCallable = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Callable>(value);
return true;
}
if (name == PropertyName.@_fieldSignal) {
this.@_fieldSignal = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Signal>(value);
return true;
}
if (name == PropertyName.@_fieldEnum) {
this.@_fieldEnum = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::ExportedFields.MyEnum>(value);
return true;
}
if (name == PropertyName.@_fieldFlagsEnum) {
this.@_fieldFlagsEnum = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::ExportedFields.MyFlagsEnum>(value);
return true;
}
if (name == PropertyName.@_fieldByteArray) {
this.@_fieldByteArray = global::Godot.NativeInterop.VariantUtils.ConvertTo<byte[]>(value);
return true;
}
if (name == PropertyName.@_fieldInt32Array) {
this.@_fieldInt32Array = global::Godot.NativeInterop.VariantUtils.ConvertTo<int[]>(value);
return true;
}
if (name == PropertyName.@_fieldInt64Array) {
this.@_fieldInt64Array = global::Godot.NativeInterop.VariantUtils.ConvertTo<long[]>(value);
return true;
}
if (name == PropertyName.@_fieldSingleArray) {
this.@_fieldSingleArray = global::Godot.NativeInterop.VariantUtils.ConvertTo<float[]>(value);
return true;
}
if (name == PropertyName.@_fieldDoubleArray) {
this.@_fieldDoubleArray = global::Godot.NativeInterop.VariantUtils.ConvertTo<double[]>(value);
return true;
}
if (name == PropertyName.@_fieldStringArray) {
this.@_fieldStringArray = global::Godot.NativeInterop.VariantUtils.ConvertTo<string[]>(value);
return true;
}
if (name == PropertyName.@_fieldStringArrayEnum) {
this.@_fieldStringArrayEnum = global::Godot.NativeInterop.VariantUtils.ConvertTo<string[]>(value);
return true;
}
if (name == PropertyName.@_fieldVector2Array) {
this.@_fieldVector2Array = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Vector2[]>(value);
return true;
}
if (name == PropertyName.@_fieldVector3Array) {
this.@_fieldVector3Array = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Vector3[]>(value);
return true;
}
if (name == PropertyName.@_fieldColorArray) {
this.@_fieldColorArray = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Color[]>(value);
return true;
}
if (name == PropertyName.@_fieldGodotObjectOrDerivedArray) {
this.@_fieldGodotObjectOrDerivedArray = global::Godot.NativeInterop.VariantUtils.ConvertToSystemArrayOfGodotObject<global::Godot.GodotObject>(value);
return true;
}
if (name == PropertyName.@_fieldStringNameArray) {
this.@_fieldStringNameArray = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.StringName[]>(value);
return true;
}
if (name == PropertyName.@_fieldNodePathArray) {
this.@_fieldNodePathArray = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.NodePath[]>(value);
return true;
}
if (name == PropertyName.@_fieldRidArray) {
this.@_fieldRidArray = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Rid[]>(value);
return true;
}
if (name == PropertyName.@_fieldEmptyInt32Array) {
this.@_fieldEmptyInt32Array = global::Godot.NativeInterop.VariantUtils.ConvertTo<int[]>(value);
return true;
}
if (name == PropertyName.@_fieldArrayFromList) {
this.@_fieldArrayFromList = global::Godot.NativeInterop.VariantUtils.ConvertTo<int[]>(value);
return true;
}
if (name == PropertyName.@_fieldVariant) {
this.@_fieldVariant = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Variant>(value);
return true;
}
if (name == PropertyName.@_fieldGodotObjectOrDerived) {
this.@_fieldGodotObjectOrDerived = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.GodotObject>(value);
return true;
}
if (name == PropertyName.@_fieldGodotResourceTexture) {
this.@_fieldGodotResourceTexture = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Texture>(value);
return true;
}
if (name == PropertyName.@_fieldStringName) {
this.@_fieldStringName = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.StringName>(value);
return true;
}
if (name == PropertyName.@_fieldNodePath) {
this.@_fieldNodePath = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.NodePath>(value);
return true;
}
if (name == PropertyName.@_fieldRid) {
this.@_fieldRid = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Rid>(value);
return true;
}
if (name == PropertyName.@_fieldGodotDictionary) {
this.@_fieldGodotDictionary = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Collections.Dictionary>(value);
return true;
}
if (name == PropertyName.@_fieldGodotArray) {
this.@_fieldGodotArray = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Collections.Array>(value);
return true;
}
if (name == PropertyName.@_fieldGodotGenericDictionary) {
this.@_fieldGodotGenericDictionary = global::Godot.NativeInterop.VariantUtils.ConvertToDictionary<string, bool>(value);
return true;
}
if (name == PropertyName.@_fieldGodotGenericArray) {
this.@_fieldGodotGenericArray = global::Godot.NativeInterop.VariantUtils.ConvertToArray<int>(value);
return true;
}
if (name == PropertyName.@_fieldEmptyInt64Array) {
this.@_fieldEmptyInt64Array = global::Godot.NativeInterop.VariantUtils.ConvertTo<long[]>(value);
return true;
}
return base.SetGodotClassPropertyValue(name, value);
}
/// <inheritdoc/>
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
protected override bool GetGodotClassPropertyValue(in godot_string_name name, out godot_variant value)
{
if (name == PropertyName.@_fieldBoolean) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<bool>(this.@_fieldBoolean);
return true;
}
if (name == PropertyName.@_fieldChar) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<char>(this.@_fieldChar);
return true;
}
if (name == PropertyName.@_fieldSByte) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<sbyte>(this.@_fieldSByte);
return true;
}
if (name == PropertyName.@_fieldInt16) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<short>(this.@_fieldInt16);
return true;
}
if (name == PropertyName.@_fieldInt32) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<int>(this.@_fieldInt32);
return true;
}
if (name == PropertyName.@_fieldInt64) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<long>(this.@_fieldInt64);
return true;
}
if (name == PropertyName.@_fieldByte) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<byte>(this.@_fieldByte);
return true;
}
if (name == PropertyName.@_fieldUInt16) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<ushort>(this.@_fieldUInt16);
return true;
}
if (name == PropertyName.@_fieldUInt32) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<uint>(this.@_fieldUInt32);
return true;
}
if (name == PropertyName.@_fieldUInt64) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<ulong>(this.@_fieldUInt64);
return true;
}
if (name == PropertyName.@_fieldSingle) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<float>(this.@_fieldSingle);
return true;
}
if (name == PropertyName.@_fieldDouble) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<double>(this.@_fieldDouble);
return true;
}
if (name == PropertyName.@_fieldString) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string>(this.@_fieldString);
return true;
}
if (name == PropertyName.@_fieldVector2) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Vector2>(this.@_fieldVector2);
return true;
}
if (name == PropertyName.@_fieldVector2I) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Vector2I>(this.@_fieldVector2I);
return true;
}
if (name == PropertyName.@_fieldRect2) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Rect2>(this.@_fieldRect2);
return true;
}
if (name == PropertyName.@_fieldRect2I) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Rect2I>(this.@_fieldRect2I);
return true;
}
if (name == PropertyName.@_fieldTransform2D) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Transform2D>(this.@_fieldTransform2D);
return true;
}
if (name == PropertyName.@_fieldVector3) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Vector3>(this.@_fieldVector3);
return true;
}
if (name == PropertyName.@_fieldVector3I) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Vector3I>(this.@_fieldVector3I);
return true;
}
if (name == PropertyName.@_fieldBasis) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Basis>(this.@_fieldBasis);
return true;
}
if (name == PropertyName.@_fieldQuaternion) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Quaternion>(this.@_fieldQuaternion);
return true;
}
if (name == PropertyName.@_fieldTransform3D) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Transform3D>(this.@_fieldTransform3D);
return true;
}
if (name == PropertyName.@_fieldVector4) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Vector4>(this.@_fieldVector4);
return true;
}
if (name == PropertyName.@_fieldVector4I) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Vector4I>(this.@_fieldVector4I);
return true;
}
if (name == PropertyName.@_fieldProjection) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Projection>(this.@_fieldProjection);
return true;
}
if (name == PropertyName.@_fieldAabb) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Aabb>(this.@_fieldAabb);
return true;
}
if (name == PropertyName.@_fieldColor) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Color>(this.@_fieldColor);
return true;
}
if (name == PropertyName.@_fieldPlane) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Plane>(this.@_fieldPlane);
return true;
}
if (name == PropertyName.@_fieldCallable) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Callable>(this.@_fieldCallable);
return true;
}
if (name == PropertyName.@_fieldSignal) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Signal>(this.@_fieldSignal);
return true;
}
if (name == PropertyName.@_fieldEnum) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::ExportedFields.MyEnum>(this.@_fieldEnum);
return true;
}
if (name == PropertyName.@_fieldFlagsEnum) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::ExportedFields.MyFlagsEnum>(this.@_fieldFlagsEnum);
return true;
}
if (name == PropertyName.@_fieldByteArray) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<byte[]>(this.@_fieldByteArray);
return true;
}
if (name == PropertyName.@_fieldInt32Array) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<int[]>(this.@_fieldInt32Array);
return true;
}
if (name == PropertyName.@_fieldInt64Array) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<long[]>(this.@_fieldInt64Array);
return true;
}
if (name == PropertyName.@_fieldSingleArray) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<float[]>(this.@_fieldSingleArray);
return true;
}
if (name == PropertyName.@_fieldDoubleArray) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<double[]>(this.@_fieldDoubleArray);
return true;
}
if (name == PropertyName.@_fieldStringArray) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string[]>(this.@_fieldStringArray);
return true;
}
if (name == PropertyName.@_fieldStringArrayEnum) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string[]>(this.@_fieldStringArrayEnum);
return true;
}
if (name == PropertyName.@_fieldVector2Array) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Vector2[]>(this.@_fieldVector2Array);
return true;
}
if (name == PropertyName.@_fieldVector3Array) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Vector3[]>(this.@_fieldVector3Array);
return true;
}
if (name == PropertyName.@_fieldColorArray) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Color[]>(this.@_fieldColorArray);
return true;
}
if (name == PropertyName.@_fieldGodotObjectOrDerivedArray) {
value = global::Godot.NativeInterop.VariantUtils.CreateFromSystemArrayOfGodotObject(this.@_fieldGodotObjectOrDerivedArray);
return true;
}
if (name == PropertyName.@_fieldStringNameArray) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.StringName[]>(this.@_fieldStringNameArray);
return true;
}
if (name == PropertyName.@_fieldNodePathArray) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.NodePath[]>(this.@_fieldNodePathArray);
return true;
}
if (name == PropertyName.@_fieldRidArray) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Rid[]>(this.@_fieldRidArray);
return true;
}
if (name == PropertyName.@_fieldEmptyInt32Array) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<int[]>(this.@_fieldEmptyInt32Array);
return true;
}
if (name == PropertyName.@_fieldArrayFromList) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<int[]>(this.@_fieldArrayFromList);
return true;
}
if (name == PropertyName.@_fieldVariant) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Variant>(this.@_fieldVariant);
return true;
}
if (name == PropertyName.@_fieldGodotObjectOrDerived) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.GodotObject>(this.@_fieldGodotObjectOrDerived);
return true;
}
if (name == PropertyName.@_fieldGodotResourceTexture) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Texture>(this.@_fieldGodotResourceTexture);
return true;
}
if (name == PropertyName.@_fieldStringName) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.StringName>(this.@_fieldStringName);
return true;
}
if (name == PropertyName.@_fieldNodePath) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.NodePath>(this.@_fieldNodePath);
return true;
}
if (name == PropertyName.@_fieldRid) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Rid>(this.@_fieldRid);
return true;
}
if (name == PropertyName.@_fieldGodotDictionary) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Collections.Dictionary>(this.@_fieldGodotDictionary);
return true;
}
if (name == PropertyName.@_fieldGodotArray) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Collections.Array>(this.@_fieldGodotArray);
return true;
}
if (name == PropertyName.@_fieldGodotGenericDictionary) {
value = global::Godot.NativeInterop.VariantUtils.CreateFromDictionary(this.@_fieldGodotGenericDictionary);
return true;
}
if (name == PropertyName.@_fieldGodotGenericArray) {
value = global::Godot.NativeInterop.VariantUtils.CreateFromArray(this.@_fieldGodotGenericArray);
return true;
}
if (name == PropertyName.@_fieldEmptyInt64Array) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<long[]>(this.@_fieldEmptyInt64Array);
return true;
}
return base.GetGodotClassPropertyValue(name, out value);
}
/// <summary>
/// Get the property information for all the properties declared in this class.
/// This method is used by Godot to register the available properties in the editor.
/// Do not call this method.
/// </summary>
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
internal new static global::System.Collections.Generic.List<global::Godot.Bridge.PropertyInfo> GetGodotPropertyList()
{
var properties = new global::System.Collections.Generic.List<global::Godot.Bridge.PropertyInfo>();
properties.Add(new(type: (global::Godot.Variant.Type)1, name: PropertyName.@_fieldBoolean, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)2, name: PropertyName.@_fieldChar, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)2, name: PropertyName.@_fieldSByte, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)2, name: PropertyName.@_fieldInt16, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)2, name: PropertyName.@_fieldInt32, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)2, name: PropertyName.@_fieldInt64, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)2, name: PropertyName.@_fieldByte, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)2, name: PropertyName.@_fieldUInt16, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)2, name: PropertyName.@_fieldUInt32, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)2, name: PropertyName.@_fieldUInt64, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)3, name: PropertyName.@_fieldSingle, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)3, name: PropertyName.@_fieldDouble, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)4, name: PropertyName.@_fieldString, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)5, name: PropertyName.@_fieldVector2, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)6, name: PropertyName.@_fieldVector2I, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)7, name: PropertyName.@_fieldRect2, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)8, name: PropertyName.@_fieldRect2I, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)11, name: PropertyName.@_fieldTransform2D, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)9, name: PropertyName.@_fieldVector3, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)10, name: PropertyName.@_fieldVector3I, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)17, name: PropertyName.@_fieldBasis, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)15, name: PropertyName.@_fieldQuaternion, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)18, name: PropertyName.@_fieldTransform3D, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)12, name: PropertyName.@_fieldVector4, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)13, name: PropertyName.@_fieldVector4I, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)19, name: PropertyName.@_fieldProjection, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)16, name: PropertyName.@_fieldAabb, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)20, name: PropertyName.@_fieldColor, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)14, name: PropertyName.@_fieldPlane, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)25, name: PropertyName.@_fieldCallable, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)26, name: PropertyName.@_fieldSignal, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)2, name: PropertyName.@_fieldEnum, hint: (global::Godot.PropertyHint)2, hintString: "A,B,C", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)2, name: PropertyName.@_fieldFlagsEnum, hint: (global::Godot.PropertyHint)6, hintString: "A:0,B:1,C:2", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)29, name: PropertyName.@_fieldByteArray, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)30, name: PropertyName.@_fieldInt32Array, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)31, name: PropertyName.@_fieldInt64Array, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)32, name: PropertyName.@_fieldSingleArray, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)33, name: PropertyName.@_fieldDoubleArray, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)34, name: PropertyName.@_fieldStringArray, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)34, name: PropertyName.@_fieldStringArrayEnum, hint: (global::Godot.PropertyHint)23, hintString: "4/2:A,B,C", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)35, name: PropertyName.@_fieldVector2Array, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)36, name: PropertyName.@_fieldVector3Array, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)37, name: PropertyName.@_fieldColorArray, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)28, name: PropertyName.@_fieldGodotObjectOrDerivedArray, hint: (global::Godot.PropertyHint)23, hintString: "24/0:", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)28, name: PropertyName.@_fieldStringNameArray, hint: (global::Godot.PropertyHint)23, hintString: "21/0:", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)28, name: PropertyName.@_fieldNodePathArray, hint: (global::Godot.PropertyHint)23, hintString: "22/0:", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)28, name: PropertyName.@_fieldRidArray, hint: (global::Godot.PropertyHint)23, hintString: "23/0:", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)30, name: PropertyName.@_fieldEmptyInt32Array, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)30, name: PropertyName.@_fieldArrayFromList, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)0, name: PropertyName.@_fieldVariant, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)135174, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)24, name: PropertyName.@_fieldGodotObjectOrDerived, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)24, name: PropertyName.@_fieldGodotResourceTexture, hint: (global::Godot.PropertyHint)17, hintString: "Texture", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)21, name: PropertyName.@_fieldStringName, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)22, name: PropertyName.@_fieldNodePath, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)23, name: PropertyName.@_fieldRid, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)27, name: PropertyName.@_fieldGodotDictionary, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)28, name: PropertyName.@_fieldGodotArray, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)27, name: PropertyName.@_fieldGodotGenericDictionary, hint: (global::Godot.PropertyHint)23, hintString: "4/0:;1/0:", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)28, name: PropertyName.@_fieldGodotGenericArray, hint: (global::Godot.PropertyHint)23, hintString: "2/0:", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)31, name: PropertyName.@_fieldEmptyInt64Array, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
return properties;
}
#pragma warning restore CS0109
}

View File

@@ -0,0 +1,139 @@
partial class ExportedFields
{
#pragma warning disable CS0109 // Disable warning about redundant 'new' keyword
#if TOOLS
/// <summary>
/// Get the default values for all properties declared in this class.
/// This method is used by Godot to determine the value that will be
/// used by the inspector when resetting properties.
/// Do not call this method.
/// </summary>
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
internal new static global::System.Collections.Generic.Dictionary<global::Godot.StringName, global::Godot.Variant> GetGodotPropertyDefaultValues()
{
var values = new global::System.Collections.Generic.Dictionary<global::Godot.StringName, global::Godot.Variant>(60);
bool ___fieldBoolean_default_value = true;
values.Add(PropertyName.@_fieldBoolean, global::Godot.Variant.From<bool>(___fieldBoolean_default_value));
char ___fieldChar_default_value = 'f';
values.Add(PropertyName.@_fieldChar, global::Godot.Variant.From<char>(___fieldChar_default_value));
sbyte ___fieldSByte_default_value = 10;
values.Add(PropertyName.@_fieldSByte, global::Godot.Variant.From<sbyte>(___fieldSByte_default_value));
short ___fieldInt16_default_value = 10;
values.Add(PropertyName.@_fieldInt16, global::Godot.Variant.From<short>(___fieldInt16_default_value));
int ___fieldInt32_default_value = 10;
values.Add(PropertyName.@_fieldInt32, global::Godot.Variant.From<int>(___fieldInt32_default_value));
long ___fieldInt64_default_value = -10_000;
values.Add(PropertyName.@_fieldInt64, global::Godot.Variant.From<long>(___fieldInt64_default_value));
byte ___fieldByte_default_value = 10;
values.Add(PropertyName.@_fieldByte, global::Godot.Variant.From<byte>(___fieldByte_default_value));
ushort ___fieldUInt16_default_value = 10;
values.Add(PropertyName.@_fieldUInt16, global::Godot.Variant.From<ushort>(___fieldUInt16_default_value));
uint ___fieldUInt32_default_value = 10;
values.Add(PropertyName.@_fieldUInt32, global::Godot.Variant.From<uint>(___fieldUInt32_default_value));
ulong ___fieldUInt64_default_value = 10;
values.Add(PropertyName.@_fieldUInt64, global::Godot.Variant.From<ulong>(___fieldUInt64_default_value));
float ___fieldSingle_default_value = 10;
values.Add(PropertyName.@_fieldSingle, global::Godot.Variant.From<float>(___fieldSingle_default_value));
double ___fieldDouble_default_value = 10;
values.Add(PropertyName.@_fieldDouble, global::Godot.Variant.From<double>(___fieldDouble_default_value));
string ___fieldString_default_value = "foo";
values.Add(PropertyName.@_fieldString, global::Godot.Variant.From<string>(___fieldString_default_value));
global::Godot.Vector2 ___fieldVector2_default_value = new(10f, 10f);
values.Add(PropertyName.@_fieldVector2, global::Godot.Variant.From<global::Godot.Vector2>(___fieldVector2_default_value));
global::Godot.Vector2I ___fieldVector2I_default_value = global::Godot.Vector2I.Up;
values.Add(PropertyName.@_fieldVector2I, global::Godot.Variant.From<global::Godot.Vector2I>(___fieldVector2I_default_value));
global::Godot.Rect2 ___fieldRect2_default_value = new(new global::Godot.Vector2(10f, 10f), new global::Godot.Vector2(10f, 10f));
values.Add(PropertyName.@_fieldRect2, global::Godot.Variant.From<global::Godot.Rect2>(___fieldRect2_default_value));
global::Godot.Rect2I ___fieldRect2I_default_value = new(new global::Godot.Vector2I(10, 10), new global::Godot.Vector2I(10, 10));
values.Add(PropertyName.@_fieldRect2I, global::Godot.Variant.From<global::Godot.Rect2I>(___fieldRect2I_default_value));
global::Godot.Transform2D ___fieldTransform2D_default_value = global::Godot.Transform2D.Identity;
values.Add(PropertyName.@_fieldTransform2D, global::Godot.Variant.From<global::Godot.Transform2D>(___fieldTransform2D_default_value));
global::Godot.Vector3 ___fieldVector3_default_value = new(10f, 10f, 10f);
values.Add(PropertyName.@_fieldVector3, global::Godot.Variant.From<global::Godot.Vector3>(___fieldVector3_default_value));
global::Godot.Vector3I ___fieldVector3I_default_value = global::Godot.Vector3I.Back;
values.Add(PropertyName.@_fieldVector3I, global::Godot.Variant.From<global::Godot.Vector3I>(___fieldVector3I_default_value));
global::Godot.Basis ___fieldBasis_default_value = new global::Godot.Basis(global::Godot.Quaternion.Identity);
values.Add(PropertyName.@_fieldBasis, global::Godot.Variant.From<global::Godot.Basis>(___fieldBasis_default_value));
global::Godot.Quaternion ___fieldQuaternion_default_value = new global::Godot.Quaternion(global::Godot.Basis.Identity);
values.Add(PropertyName.@_fieldQuaternion, global::Godot.Variant.From<global::Godot.Quaternion>(___fieldQuaternion_default_value));
global::Godot.Transform3D ___fieldTransform3D_default_value = global::Godot.Transform3D.Identity;
values.Add(PropertyName.@_fieldTransform3D, global::Godot.Variant.From<global::Godot.Transform3D>(___fieldTransform3D_default_value));
global::Godot.Vector4 ___fieldVector4_default_value = new(10f, 10f, 10f, 10f);
values.Add(PropertyName.@_fieldVector4, global::Godot.Variant.From<global::Godot.Vector4>(___fieldVector4_default_value));
global::Godot.Vector4I ___fieldVector4I_default_value = global::Godot.Vector4I.One;
values.Add(PropertyName.@_fieldVector4I, global::Godot.Variant.From<global::Godot.Vector4I>(___fieldVector4I_default_value));
global::Godot.Projection ___fieldProjection_default_value = global::Godot.Projection.Identity;
values.Add(PropertyName.@_fieldProjection, global::Godot.Variant.From<global::Godot.Projection>(___fieldProjection_default_value));
global::Godot.Aabb ___fieldAabb_default_value = new global::Godot.Aabb(10f, 10f, 10f, new global::Godot.Vector3(1f, 1f, 1f));
values.Add(PropertyName.@_fieldAabb, global::Godot.Variant.From<global::Godot.Aabb>(___fieldAabb_default_value));
global::Godot.Color ___fieldColor_default_value = global::Godot.Colors.Aquamarine;
values.Add(PropertyName.@_fieldColor, global::Godot.Variant.From<global::Godot.Color>(___fieldColor_default_value));
global::Godot.Plane ___fieldPlane_default_value = global::Godot.Plane.PlaneXZ;
values.Add(PropertyName.@_fieldPlane, global::Godot.Variant.From<global::Godot.Plane>(___fieldPlane_default_value));
global::Godot.Callable ___fieldCallable_default_value = new global::Godot.Callable(global::Godot.Engine.GetMainLoop(), "_process");
values.Add(PropertyName.@_fieldCallable, global::Godot.Variant.From<global::Godot.Callable>(___fieldCallable_default_value));
global::Godot.Signal ___fieldSignal_default_value = new global::Godot.Signal(global::Godot.Engine.GetMainLoop(), "property_list_changed");
values.Add(PropertyName.@_fieldSignal, global::Godot.Variant.From<global::Godot.Signal>(___fieldSignal_default_value));
global::ExportedFields.MyEnum ___fieldEnum_default_value = global::ExportedFields.MyEnum.C;
values.Add(PropertyName.@_fieldEnum, global::Godot.Variant.From<global::ExportedFields.MyEnum>(___fieldEnum_default_value));
global::ExportedFields.MyFlagsEnum ___fieldFlagsEnum_default_value = global::ExportedFields.MyFlagsEnum.C;
values.Add(PropertyName.@_fieldFlagsEnum, global::Godot.Variant.From<global::ExportedFields.MyFlagsEnum>(___fieldFlagsEnum_default_value));
byte[] ___fieldByteArray_default_value = { 0, 1, 2, 3, 4, 5, 6 };
values.Add(PropertyName.@_fieldByteArray, global::Godot.Variant.From<byte[]>(___fieldByteArray_default_value));
int[] ___fieldInt32Array_default_value = { 0, 1, 2, 3, 4, 5, 6 };
values.Add(PropertyName.@_fieldInt32Array, global::Godot.Variant.From<int[]>(___fieldInt32Array_default_value));
long[] ___fieldInt64Array_default_value = { 0, 1, 2, 3, 4, 5, 6 };
values.Add(PropertyName.@_fieldInt64Array, global::Godot.Variant.From<long[]>(___fieldInt64Array_default_value));
float[] ___fieldSingleArray_default_value = { 0f, 1f, 2f, 3f, 4f, 5f, 6f };
values.Add(PropertyName.@_fieldSingleArray, global::Godot.Variant.From<float[]>(___fieldSingleArray_default_value));
double[] ___fieldDoubleArray_default_value = { 0d, 1d, 2d, 3d, 4d, 5d, 6d };
values.Add(PropertyName.@_fieldDoubleArray, global::Godot.Variant.From<double[]>(___fieldDoubleArray_default_value));
string[] ___fieldStringArray_default_value = { "foo", "bar" };
values.Add(PropertyName.@_fieldStringArray, global::Godot.Variant.From<string[]>(___fieldStringArray_default_value));
string[] ___fieldStringArrayEnum_default_value = { "foo", "bar" };
values.Add(PropertyName.@_fieldStringArrayEnum, global::Godot.Variant.From<string[]>(___fieldStringArrayEnum_default_value));
global::Godot.Vector2[] ___fieldVector2Array_default_value = { global::Godot.Vector2.Up, global::Godot.Vector2.Down, global::Godot.Vector2.Left, global::Godot.Vector2.Right };
values.Add(PropertyName.@_fieldVector2Array, global::Godot.Variant.From<global::Godot.Vector2[]>(___fieldVector2Array_default_value));
global::Godot.Vector3[] ___fieldVector3Array_default_value = { global::Godot.Vector3.Up, global::Godot.Vector3.Down, global::Godot.Vector3.Left, global::Godot.Vector3.Right };
values.Add(PropertyName.@_fieldVector3Array, global::Godot.Variant.From<global::Godot.Vector3[]>(___fieldVector3Array_default_value));
global::Godot.Color[] ___fieldColorArray_default_value = { global::Godot.Colors.Aqua, global::Godot.Colors.Aquamarine, global::Godot.Colors.Azure, global::Godot.Colors.Beige };
values.Add(PropertyName.@_fieldColorArray, global::Godot.Variant.From<global::Godot.Color[]>(___fieldColorArray_default_value));
global::Godot.GodotObject[] ___fieldGodotObjectOrDerivedArray_default_value = { null };
values.Add(PropertyName.@_fieldGodotObjectOrDerivedArray, global::Godot.Variant.CreateFrom(___fieldGodotObjectOrDerivedArray_default_value));
global::Godot.StringName[] ___fieldStringNameArray_default_value = { "foo", "bar" };
values.Add(PropertyName.@_fieldStringNameArray, global::Godot.Variant.From<global::Godot.StringName[]>(___fieldStringNameArray_default_value));
global::Godot.NodePath[] ___fieldNodePathArray_default_value = { "foo", "bar" };
values.Add(PropertyName.@_fieldNodePathArray, global::Godot.Variant.From<global::Godot.NodePath[]>(___fieldNodePathArray_default_value));
global::Godot.Rid[] ___fieldRidArray_default_value = { default, default, default };
values.Add(PropertyName.@_fieldRidArray, global::Godot.Variant.From<global::Godot.Rid[]>(___fieldRidArray_default_value));
int[] ___fieldEmptyInt32Array_default_value = global::System.Array.Empty<int>();
values.Add(PropertyName.@_fieldEmptyInt32Array, global::Godot.Variant.From<int[]>(___fieldEmptyInt32Array_default_value));
int[] ___fieldArrayFromList_default_value = new global::System.Collections.Generic.List<int>(global::System.Array.Empty<int>()).ToArray();
values.Add(PropertyName.@_fieldArrayFromList, global::Godot.Variant.From<int[]>(___fieldArrayFromList_default_value));
global::Godot.Variant ___fieldVariant_default_value = "foo";
values.Add(PropertyName.@_fieldVariant, global::Godot.Variant.From<global::Godot.Variant>(___fieldVariant_default_value));
global::Godot.GodotObject ___fieldGodotObjectOrDerived_default_value = default;
values.Add(PropertyName.@_fieldGodotObjectOrDerived, global::Godot.Variant.From<global::Godot.GodotObject>(___fieldGodotObjectOrDerived_default_value));
global::Godot.Texture ___fieldGodotResourceTexture_default_value = default;
values.Add(PropertyName.@_fieldGodotResourceTexture, global::Godot.Variant.From<global::Godot.Texture>(___fieldGodotResourceTexture_default_value));
global::Godot.StringName ___fieldStringName_default_value = new global::Godot.StringName("foo");
values.Add(PropertyName.@_fieldStringName, global::Godot.Variant.From<global::Godot.StringName>(___fieldStringName_default_value));
global::Godot.NodePath ___fieldNodePath_default_value = new global::Godot.NodePath("foo");
values.Add(PropertyName.@_fieldNodePath, global::Godot.Variant.From<global::Godot.NodePath>(___fieldNodePath_default_value));
global::Godot.Rid ___fieldRid_default_value = default;
values.Add(PropertyName.@_fieldRid, global::Godot.Variant.From<global::Godot.Rid>(___fieldRid_default_value));
global::Godot.Collections.Dictionary ___fieldGodotDictionary_default_value = new() { { "foo", 10 }, { global::Godot.Vector2.Up, global::Godot.Colors.Chocolate } };
values.Add(PropertyName.@_fieldGodotDictionary, global::Godot.Variant.From<global::Godot.Collections.Dictionary>(___fieldGodotDictionary_default_value));
global::Godot.Collections.Array ___fieldGodotArray_default_value = new() { "foo", 10, global::Godot.Vector2.Up, global::Godot.Colors.Chocolate };
values.Add(PropertyName.@_fieldGodotArray, global::Godot.Variant.From<global::Godot.Collections.Array>(___fieldGodotArray_default_value));
global::Godot.Collections.Dictionary<string, bool> ___fieldGodotGenericDictionary_default_value = new() { { "foo", true }, { "bar", false } };
values.Add(PropertyName.@_fieldGodotGenericDictionary, global::Godot.Variant.CreateFrom(___fieldGodotGenericDictionary_default_value));
global::Godot.Collections.Array<int> ___fieldGodotGenericArray_default_value = new() { 0, 1, 2, 3, 4, 5, 6 };
values.Add(PropertyName.@_fieldGodotGenericArray, global::Godot.Variant.CreateFrom(___fieldGodotGenericArray_default_value));
long[] ___fieldEmptyInt64Array_default_value = global::System.Array.Empty<long>();
values.Add(PropertyName.@_fieldEmptyInt64Array, global::Godot.Variant.From<long[]>(___fieldEmptyInt64Array_default_value));
return values;
}
#endif // TOOLS
#pragma warning restore CS0109
}

View File

@@ -0,0 +1,25 @@
partial class ExportedProperties2
{
#pragma warning disable CS0109 // Disable warning about redundant 'new' keyword
#if TOOLS
/// <summary>
/// Get the default values for all properties declared in this class.
/// This method is used by Godot to determine the value that will be
/// used by the inspector when resetting properties.
/// Do not call this method.
/// </summary>
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
internal new static global::System.Collections.Generic.Dictionary<global::Godot.StringName, global::Godot.Variant> GetGodotPropertyDefaultValues()
{
var values = new global::System.Collections.Generic.Dictionary<global::Godot.StringName, global::Godot.Variant>(3);
int __Health_default_value = default;
values.Add(PropertyName.@Health, global::Godot.Variant.From<int>(__Health_default_value));
global::Godot.Resource __SubResource_default_value = default;
values.Add(PropertyName.@SubResource, global::Godot.Variant.From<global::Godot.Resource>(__SubResource_default_value));
string[] __Strings_default_value = default;
values.Add(PropertyName.@Strings, global::Godot.Variant.From<string[]>(__Strings_default_value));
return values;
}
#endif // TOOLS
#pragma warning restore CS0109
}

View File

@@ -0,0 +1,933 @@
using Godot;
using Godot.NativeInterop;
partial class ExportedProperties
{
#pragma warning disable CS0109 // Disable warning about redundant 'new' keyword
/// <summary>
/// Cached StringNames for the properties and fields contained in this class, for fast lookup.
/// </summary>
public new class PropertyName : global::Godot.GodotObject.PropertyName {
/// <summary>
/// Cached name for the 'NotGenerateComplexLamdaProperty' property.
/// </summary>
public new static readonly global::Godot.StringName @NotGenerateComplexLamdaProperty = "NotGenerateComplexLamdaProperty";
/// <summary>
/// Cached name for the 'NotGenerateLamdaNoFieldProperty' property.
/// </summary>
public new static readonly global::Godot.StringName @NotGenerateLamdaNoFieldProperty = "NotGenerateLamdaNoFieldProperty";
/// <summary>
/// Cached name for the 'NotGenerateComplexReturnProperty' property.
/// </summary>
public new static readonly global::Godot.StringName @NotGenerateComplexReturnProperty = "NotGenerateComplexReturnProperty";
/// <summary>
/// Cached name for the 'NotGenerateReturnsProperty' property.
/// </summary>
public new static readonly global::Godot.StringName @NotGenerateReturnsProperty = "NotGenerateReturnsProperty";
/// <summary>
/// Cached name for the 'FullPropertyString' property.
/// </summary>
public new static readonly global::Godot.StringName @FullPropertyString = "FullPropertyString";
/// <summary>
/// Cached name for the 'FullPropertyString_Complex' property.
/// </summary>
public new static readonly global::Godot.StringName @FullPropertyString_Complex = "FullPropertyString_Complex";
/// <summary>
/// Cached name for the 'LamdaPropertyString' property.
/// </summary>
public new static readonly global::Godot.StringName @LamdaPropertyString = "LamdaPropertyString";
/// <summary>
/// Cached name for the 'PropertyBoolean' property.
/// </summary>
public new static readonly global::Godot.StringName @PropertyBoolean = "PropertyBoolean";
/// <summary>
/// Cached name for the 'PropertyChar' property.
/// </summary>
public new static readonly global::Godot.StringName @PropertyChar = "PropertyChar";
/// <summary>
/// Cached name for the 'PropertySByte' property.
/// </summary>
public new static readonly global::Godot.StringName @PropertySByte = "PropertySByte";
/// <summary>
/// Cached name for the 'PropertyInt16' property.
/// </summary>
public new static readonly global::Godot.StringName @PropertyInt16 = "PropertyInt16";
/// <summary>
/// Cached name for the 'PropertyInt32' property.
/// </summary>
public new static readonly global::Godot.StringName @PropertyInt32 = "PropertyInt32";
/// <summary>
/// Cached name for the 'PropertyInt64' property.
/// </summary>
public new static readonly global::Godot.StringName @PropertyInt64 = "PropertyInt64";
/// <summary>
/// Cached name for the 'PropertyByte' property.
/// </summary>
public new static readonly global::Godot.StringName @PropertyByte = "PropertyByte";
/// <summary>
/// Cached name for the 'PropertyUInt16' property.
/// </summary>
public new static readonly global::Godot.StringName @PropertyUInt16 = "PropertyUInt16";
/// <summary>
/// Cached name for the 'PropertyUInt32' property.
/// </summary>
public new static readonly global::Godot.StringName @PropertyUInt32 = "PropertyUInt32";
/// <summary>
/// Cached name for the 'PropertyUInt64' property.
/// </summary>
public new static readonly global::Godot.StringName @PropertyUInt64 = "PropertyUInt64";
/// <summary>
/// Cached name for the 'PropertySingle' property.
/// </summary>
public new static readonly global::Godot.StringName @PropertySingle = "PropertySingle";
/// <summary>
/// Cached name for the 'PropertyDouble' property.
/// </summary>
public new static readonly global::Godot.StringName @PropertyDouble = "PropertyDouble";
/// <summary>
/// Cached name for the 'PropertyString' property.
/// </summary>
public new static readonly global::Godot.StringName @PropertyString = "PropertyString";
/// <summary>
/// Cached name for the 'PropertyVector2' property.
/// </summary>
public new static readonly global::Godot.StringName @PropertyVector2 = "PropertyVector2";
/// <summary>
/// Cached name for the 'PropertyVector2I' property.
/// </summary>
public new static readonly global::Godot.StringName @PropertyVector2I = "PropertyVector2I";
/// <summary>
/// Cached name for the 'PropertyRect2' property.
/// </summary>
public new static readonly global::Godot.StringName @PropertyRect2 = "PropertyRect2";
/// <summary>
/// Cached name for the 'PropertyRect2I' property.
/// </summary>
public new static readonly global::Godot.StringName @PropertyRect2I = "PropertyRect2I";
/// <summary>
/// Cached name for the 'PropertyTransform2D' property.
/// </summary>
public new static readonly global::Godot.StringName @PropertyTransform2D = "PropertyTransform2D";
/// <summary>
/// Cached name for the 'PropertyVector3' property.
/// </summary>
public new static readonly global::Godot.StringName @PropertyVector3 = "PropertyVector3";
/// <summary>
/// Cached name for the 'PropertyVector3I' property.
/// </summary>
public new static readonly global::Godot.StringName @PropertyVector3I = "PropertyVector3I";
/// <summary>
/// Cached name for the 'PropertyBasis' property.
/// </summary>
public new static readonly global::Godot.StringName @PropertyBasis = "PropertyBasis";
/// <summary>
/// Cached name for the 'PropertyQuaternion' property.
/// </summary>
public new static readonly global::Godot.StringName @PropertyQuaternion = "PropertyQuaternion";
/// <summary>
/// Cached name for the 'PropertyTransform3D' property.
/// </summary>
public new static readonly global::Godot.StringName @PropertyTransform3D = "PropertyTransform3D";
/// <summary>
/// Cached name for the 'PropertyVector4' property.
/// </summary>
public new static readonly global::Godot.StringName @PropertyVector4 = "PropertyVector4";
/// <summary>
/// Cached name for the 'PropertyVector4I' property.
/// </summary>
public new static readonly global::Godot.StringName @PropertyVector4I = "PropertyVector4I";
/// <summary>
/// Cached name for the 'PropertyProjection' property.
/// </summary>
public new static readonly global::Godot.StringName @PropertyProjection = "PropertyProjection";
/// <summary>
/// Cached name for the 'PropertyAabb' property.
/// </summary>
public new static readonly global::Godot.StringName @PropertyAabb = "PropertyAabb";
/// <summary>
/// Cached name for the 'PropertyColor' property.
/// </summary>
public new static readonly global::Godot.StringName @PropertyColor = "PropertyColor";
/// <summary>
/// Cached name for the 'PropertyPlane' property.
/// </summary>
public new static readonly global::Godot.StringName @PropertyPlane = "PropertyPlane";
/// <summary>
/// Cached name for the 'PropertyCallable' property.
/// </summary>
public new static readonly global::Godot.StringName @PropertyCallable = "PropertyCallable";
/// <summary>
/// Cached name for the 'PropertySignal' property.
/// </summary>
public new static readonly global::Godot.StringName @PropertySignal = "PropertySignal";
/// <summary>
/// Cached name for the 'PropertyEnum' property.
/// </summary>
public new static readonly global::Godot.StringName @PropertyEnum = "PropertyEnum";
/// <summary>
/// Cached name for the 'PropertyFlagsEnum' property.
/// </summary>
public new static readonly global::Godot.StringName @PropertyFlagsEnum = "PropertyFlagsEnum";
/// <summary>
/// Cached name for the 'PropertyByteArray' property.
/// </summary>
public new static readonly global::Godot.StringName @PropertyByteArray = "PropertyByteArray";
/// <summary>
/// Cached name for the 'PropertyInt32Array' property.
/// </summary>
public new static readonly global::Godot.StringName @PropertyInt32Array = "PropertyInt32Array";
/// <summary>
/// Cached name for the 'PropertyInt64Array' property.
/// </summary>
public new static readonly global::Godot.StringName @PropertyInt64Array = "PropertyInt64Array";
/// <summary>
/// Cached name for the 'PropertySingleArray' property.
/// </summary>
public new static readonly global::Godot.StringName @PropertySingleArray = "PropertySingleArray";
/// <summary>
/// Cached name for the 'PropertyDoubleArray' property.
/// </summary>
public new static readonly global::Godot.StringName @PropertyDoubleArray = "PropertyDoubleArray";
/// <summary>
/// Cached name for the 'PropertyStringArray' property.
/// </summary>
public new static readonly global::Godot.StringName @PropertyStringArray = "PropertyStringArray";
/// <summary>
/// Cached name for the 'PropertyStringArrayEnum' property.
/// </summary>
public new static readonly global::Godot.StringName @PropertyStringArrayEnum = "PropertyStringArrayEnum";
/// <summary>
/// Cached name for the 'PropertyVector2Array' property.
/// </summary>
public new static readonly global::Godot.StringName @PropertyVector2Array = "PropertyVector2Array";
/// <summary>
/// Cached name for the 'PropertyVector3Array' property.
/// </summary>
public new static readonly global::Godot.StringName @PropertyVector3Array = "PropertyVector3Array";
/// <summary>
/// Cached name for the 'PropertyColorArray' property.
/// </summary>
public new static readonly global::Godot.StringName @PropertyColorArray = "PropertyColorArray";
/// <summary>
/// Cached name for the 'PropertyGodotObjectOrDerivedArray' property.
/// </summary>
public new static readonly global::Godot.StringName @PropertyGodotObjectOrDerivedArray = "PropertyGodotObjectOrDerivedArray";
/// <summary>
/// Cached name for the 'field_StringNameArray' property.
/// </summary>
public new static readonly global::Godot.StringName @field_StringNameArray = "field_StringNameArray";
/// <summary>
/// Cached name for the 'field_NodePathArray' property.
/// </summary>
public new static readonly global::Godot.StringName @field_NodePathArray = "field_NodePathArray";
/// <summary>
/// Cached name for the 'field_RidArray' property.
/// </summary>
public new static readonly global::Godot.StringName @field_RidArray = "field_RidArray";
/// <summary>
/// Cached name for the 'PropertyVariant' property.
/// </summary>
public new static readonly global::Godot.StringName @PropertyVariant = "PropertyVariant";
/// <summary>
/// Cached name for the 'PropertyGodotObjectOrDerived' property.
/// </summary>
public new static readonly global::Godot.StringName @PropertyGodotObjectOrDerived = "PropertyGodotObjectOrDerived";
/// <summary>
/// Cached name for the 'PropertyGodotResourceTexture' property.
/// </summary>
public new static readonly global::Godot.StringName @PropertyGodotResourceTexture = "PropertyGodotResourceTexture";
/// <summary>
/// Cached name for the 'PropertyStringName' property.
/// </summary>
public new static readonly global::Godot.StringName @PropertyStringName = "PropertyStringName";
/// <summary>
/// Cached name for the 'PropertyNodePath' property.
/// </summary>
public new static readonly global::Godot.StringName @PropertyNodePath = "PropertyNodePath";
/// <summary>
/// Cached name for the 'PropertyRid' property.
/// </summary>
public new static readonly global::Godot.StringName @PropertyRid = "PropertyRid";
/// <summary>
/// Cached name for the 'PropertyGodotDictionary' property.
/// </summary>
public new static readonly global::Godot.StringName @PropertyGodotDictionary = "PropertyGodotDictionary";
/// <summary>
/// Cached name for the 'PropertyGodotArray' property.
/// </summary>
public new static readonly global::Godot.StringName @PropertyGodotArray = "PropertyGodotArray";
/// <summary>
/// Cached name for the 'PropertyGodotGenericDictionary' property.
/// </summary>
public new static readonly global::Godot.StringName @PropertyGodotGenericDictionary = "PropertyGodotGenericDictionary";
/// <summary>
/// Cached name for the 'PropertyGodotGenericArray' property.
/// </summary>
public new static readonly global::Godot.StringName @PropertyGodotGenericArray = "PropertyGodotGenericArray";
/// <summary>
/// Cached name for the '_notGeneratePropertyString' field.
/// </summary>
public new static readonly global::Godot.StringName @_notGeneratePropertyString = "_notGeneratePropertyString";
/// <summary>
/// Cached name for the '_notGeneratePropertyInt' field.
/// </summary>
public new static readonly global::Godot.StringName @_notGeneratePropertyInt = "_notGeneratePropertyInt";
/// <summary>
/// Cached name for the '_fullPropertyString' field.
/// </summary>
public new static readonly global::Godot.StringName @_fullPropertyString = "_fullPropertyString";
/// <summary>
/// Cached name for the '_fullPropertyStringComplex' field.
/// </summary>
public new static readonly global::Godot.StringName @_fullPropertyStringComplex = "_fullPropertyStringComplex";
/// <summary>
/// Cached name for the '_lamdaPropertyString' field.
/// </summary>
public new static readonly global::Godot.StringName @_lamdaPropertyString = "_lamdaPropertyString";
}
/// <inheritdoc/>
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
protected override bool SetGodotClassPropertyValue(in godot_string_name name, in godot_variant value)
{
if (name == PropertyName.@NotGenerateComplexLamdaProperty) {
this.@NotGenerateComplexLamdaProperty = global::Godot.NativeInterop.VariantUtils.ConvertTo<string>(value);
return true;
}
if (name == PropertyName.@NotGenerateLamdaNoFieldProperty) {
this.@NotGenerateLamdaNoFieldProperty = global::Godot.NativeInterop.VariantUtils.ConvertTo<string>(value);
return true;
}
if (name == PropertyName.@NotGenerateComplexReturnProperty) {
this.@NotGenerateComplexReturnProperty = global::Godot.NativeInterop.VariantUtils.ConvertTo<string>(value);
return true;
}
if (name == PropertyName.@NotGenerateReturnsProperty) {
this.@NotGenerateReturnsProperty = global::Godot.NativeInterop.VariantUtils.ConvertTo<string>(value);
return true;
}
if (name == PropertyName.@FullPropertyString) {
this.@FullPropertyString = global::Godot.NativeInterop.VariantUtils.ConvertTo<string>(value);
return true;
}
if (name == PropertyName.@FullPropertyString_Complex) {
this.@FullPropertyString_Complex = global::Godot.NativeInterop.VariantUtils.ConvertTo<string>(value);
return true;
}
if (name == PropertyName.@LamdaPropertyString) {
this.@LamdaPropertyString = global::Godot.NativeInterop.VariantUtils.ConvertTo<string>(value);
return true;
}
if (name == PropertyName.@PropertyBoolean) {
this.@PropertyBoolean = global::Godot.NativeInterop.VariantUtils.ConvertTo<bool>(value);
return true;
}
if (name == PropertyName.@PropertyChar) {
this.@PropertyChar = global::Godot.NativeInterop.VariantUtils.ConvertTo<char>(value);
return true;
}
if (name == PropertyName.@PropertySByte) {
this.@PropertySByte = global::Godot.NativeInterop.VariantUtils.ConvertTo<sbyte>(value);
return true;
}
if (name == PropertyName.@PropertyInt16) {
this.@PropertyInt16 = global::Godot.NativeInterop.VariantUtils.ConvertTo<short>(value);
return true;
}
if (name == PropertyName.@PropertyInt32) {
this.@PropertyInt32 = global::Godot.NativeInterop.VariantUtils.ConvertTo<int>(value);
return true;
}
if (name == PropertyName.@PropertyInt64) {
this.@PropertyInt64 = global::Godot.NativeInterop.VariantUtils.ConvertTo<long>(value);
return true;
}
if (name == PropertyName.@PropertyByte) {
this.@PropertyByte = global::Godot.NativeInterop.VariantUtils.ConvertTo<byte>(value);
return true;
}
if (name == PropertyName.@PropertyUInt16) {
this.@PropertyUInt16 = global::Godot.NativeInterop.VariantUtils.ConvertTo<ushort>(value);
return true;
}
if (name == PropertyName.@PropertyUInt32) {
this.@PropertyUInt32 = global::Godot.NativeInterop.VariantUtils.ConvertTo<uint>(value);
return true;
}
if (name == PropertyName.@PropertyUInt64) {
this.@PropertyUInt64 = global::Godot.NativeInterop.VariantUtils.ConvertTo<ulong>(value);
return true;
}
if (name == PropertyName.@PropertySingle) {
this.@PropertySingle = global::Godot.NativeInterop.VariantUtils.ConvertTo<float>(value);
return true;
}
if (name == PropertyName.@PropertyDouble) {
this.@PropertyDouble = global::Godot.NativeInterop.VariantUtils.ConvertTo<double>(value);
return true;
}
if (name == PropertyName.@PropertyString) {
this.@PropertyString = global::Godot.NativeInterop.VariantUtils.ConvertTo<string>(value);
return true;
}
if (name == PropertyName.@PropertyVector2) {
this.@PropertyVector2 = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Vector2>(value);
return true;
}
if (name == PropertyName.@PropertyVector2I) {
this.@PropertyVector2I = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Vector2I>(value);
return true;
}
if (name == PropertyName.@PropertyRect2) {
this.@PropertyRect2 = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Rect2>(value);
return true;
}
if (name == PropertyName.@PropertyRect2I) {
this.@PropertyRect2I = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Rect2I>(value);
return true;
}
if (name == PropertyName.@PropertyTransform2D) {
this.@PropertyTransform2D = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Transform2D>(value);
return true;
}
if (name == PropertyName.@PropertyVector3) {
this.@PropertyVector3 = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Vector3>(value);
return true;
}
if (name == PropertyName.@PropertyVector3I) {
this.@PropertyVector3I = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Vector3I>(value);
return true;
}
if (name == PropertyName.@PropertyBasis) {
this.@PropertyBasis = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Basis>(value);
return true;
}
if (name == PropertyName.@PropertyQuaternion) {
this.@PropertyQuaternion = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Quaternion>(value);
return true;
}
if (name == PropertyName.@PropertyTransform3D) {
this.@PropertyTransform3D = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Transform3D>(value);
return true;
}
if (name == PropertyName.@PropertyVector4) {
this.@PropertyVector4 = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Vector4>(value);
return true;
}
if (name == PropertyName.@PropertyVector4I) {
this.@PropertyVector4I = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Vector4I>(value);
return true;
}
if (name == PropertyName.@PropertyProjection) {
this.@PropertyProjection = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Projection>(value);
return true;
}
if (name == PropertyName.@PropertyAabb) {
this.@PropertyAabb = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Aabb>(value);
return true;
}
if (name == PropertyName.@PropertyColor) {
this.@PropertyColor = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Color>(value);
return true;
}
if (name == PropertyName.@PropertyPlane) {
this.@PropertyPlane = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Plane>(value);
return true;
}
if (name == PropertyName.@PropertyCallable) {
this.@PropertyCallable = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Callable>(value);
return true;
}
if (name == PropertyName.@PropertySignal) {
this.@PropertySignal = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Signal>(value);
return true;
}
if (name == PropertyName.@PropertyEnum) {
this.@PropertyEnum = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::ExportedProperties.MyEnum>(value);
return true;
}
if (name == PropertyName.@PropertyFlagsEnum) {
this.@PropertyFlagsEnum = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::ExportedProperties.MyFlagsEnum>(value);
return true;
}
if (name == PropertyName.@PropertyByteArray) {
this.@PropertyByteArray = global::Godot.NativeInterop.VariantUtils.ConvertTo<byte[]>(value);
return true;
}
if (name == PropertyName.@PropertyInt32Array) {
this.@PropertyInt32Array = global::Godot.NativeInterop.VariantUtils.ConvertTo<int[]>(value);
return true;
}
if (name == PropertyName.@PropertyInt64Array) {
this.@PropertyInt64Array = global::Godot.NativeInterop.VariantUtils.ConvertTo<long[]>(value);
return true;
}
if (name == PropertyName.@PropertySingleArray) {
this.@PropertySingleArray = global::Godot.NativeInterop.VariantUtils.ConvertTo<float[]>(value);
return true;
}
if (name == PropertyName.@PropertyDoubleArray) {
this.@PropertyDoubleArray = global::Godot.NativeInterop.VariantUtils.ConvertTo<double[]>(value);
return true;
}
if (name == PropertyName.@PropertyStringArray) {
this.@PropertyStringArray = global::Godot.NativeInterop.VariantUtils.ConvertTo<string[]>(value);
return true;
}
if (name == PropertyName.@PropertyStringArrayEnum) {
this.@PropertyStringArrayEnum = global::Godot.NativeInterop.VariantUtils.ConvertTo<string[]>(value);
return true;
}
if (name == PropertyName.@PropertyVector2Array) {
this.@PropertyVector2Array = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Vector2[]>(value);
return true;
}
if (name == PropertyName.@PropertyVector3Array) {
this.@PropertyVector3Array = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Vector3[]>(value);
return true;
}
if (name == PropertyName.@PropertyColorArray) {
this.@PropertyColorArray = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Color[]>(value);
return true;
}
if (name == PropertyName.@PropertyGodotObjectOrDerivedArray) {
this.@PropertyGodotObjectOrDerivedArray = global::Godot.NativeInterop.VariantUtils.ConvertToSystemArrayOfGodotObject<global::Godot.GodotObject>(value);
return true;
}
if (name == PropertyName.@field_StringNameArray) {
this.@field_StringNameArray = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.StringName[]>(value);
return true;
}
if (name == PropertyName.@field_NodePathArray) {
this.@field_NodePathArray = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.NodePath[]>(value);
return true;
}
if (name == PropertyName.@field_RidArray) {
this.@field_RidArray = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Rid[]>(value);
return true;
}
if (name == PropertyName.@PropertyVariant) {
this.@PropertyVariant = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Variant>(value);
return true;
}
if (name == PropertyName.@PropertyGodotObjectOrDerived) {
this.@PropertyGodotObjectOrDerived = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.GodotObject>(value);
return true;
}
if (name == PropertyName.@PropertyGodotResourceTexture) {
this.@PropertyGodotResourceTexture = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Texture>(value);
return true;
}
if (name == PropertyName.@PropertyStringName) {
this.@PropertyStringName = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.StringName>(value);
return true;
}
if (name == PropertyName.@PropertyNodePath) {
this.@PropertyNodePath = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.NodePath>(value);
return true;
}
if (name == PropertyName.@PropertyRid) {
this.@PropertyRid = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Rid>(value);
return true;
}
if (name == PropertyName.@PropertyGodotDictionary) {
this.@PropertyGodotDictionary = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Collections.Dictionary>(value);
return true;
}
if (name == PropertyName.@PropertyGodotArray) {
this.@PropertyGodotArray = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Collections.Array>(value);
return true;
}
if (name == PropertyName.@PropertyGodotGenericDictionary) {
this.@PropertyGodotGenericDictionary = global::Godot.NativeInterop.VariantUtils.ConvertToDictionary<string, bool>(value);
return true;
}
if (name == PropertyName.@PropertyGodotGenericArray) {
this.@PropertyGodotGenericArray = global::Godot.NativeInterop.VariantUtils.ConvertToArray<int>(value);
return true;
}
if (name == PropertyName.@_notGeneratePropertyString) {
this.@_notGeneratePropertyString = global::Godot.NativeInterop.VariantUtils.ConvertTo<string>(value);
return true;
}
if (name == PropertyName.@_notGeneratePropertyInt) {
this.@_notGeneratePropertyInt = global::Godot.NativeInterop.VariantUtils.ConvertTo<int>(value);
return true;
}
if (name == PropertyName.@_fullPropertyString) {
this.@_fullPropertyString = global::Godot.NativeInterop.VariantUtils.ConvertTo<string>(value);
return true;
}
if (name == PropertyName.@_fullPropertyStringComplex) {
this.@_fullPropertyStringComplex = global::Godot.NativeInterop.VariantUtils.ConvertTo<string>(value);
return true;
}
if (name == PropertyName.@_lamdaPropertyString) {
this.@_lamdaPropertyString = global::Godot.NativeInterop.VariantUtils.ConvertTo<string>(value);
return true;
}
return base.SetGodotClassPropertyValue(name, value);
}
/// <inheritdoc/>
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
protected override bool GetGodotClassPropertyValue(in godot_string_name name, out godot_variant value)
{
if (name == PropertyName.@NotGenerateComplexLamdaProperty) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string>(this.@NotGenerateComplexLamdaProperty);
return true;
}
if (name == PropertyName.@NotGenerateLamdaNoFieldProperty) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string>(this.@NotGenerateLamdaNoFieldProperty);
return true;
}
if (name == PropertyName.@NotGenerateComplexReturnProperty) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string>(this.@NotGenerateComplexReturnProperty);
return true;
}
if (name == PropertyName.@NotGenerateReturnsProperty) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string>(this.@NotGenerateReturnsProperty);
return true;
}
if (name == PropertyName.@FullPropertyString) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string>(this.@FullPropertyString);
return true;
}
if (name == PropertyName.@FullPropertyString_Complex) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string>(this.@FullPropertyString_Complex);
return true;
}
if (name == PropertyName.@LamdaPropertyString) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string>(this.@LamdaPropertyString);
return true;
}
if (name == PropertyName.@PropertyBoolean) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<bool>(this.@PropertyBoolean);
return true;
}
if (name == PropertyName.@PropertyChar) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<char>(this.@PropertyChar);
return true;
}
if (name == PropertyName.@PropertySByte) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<sbyte>(this.@PropertySByte);
return true;
}
if (name == PropertyName.@PropertyInt16) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<short>(this.@PropertyInt16);
return true;
}
if (name == PropertyName.@PropertyInt32) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<int>(this.@PropertyInt32);
return true;
}
if (name == PropertyName.@PropertyInt64) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<long>(this.@PropertyInt64);
return true;
}
if (name == PropertyName.@PropertyByte) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<byte>(this.@PropertyByte);
return true;
}
if (name == PropertyName.@PropertyUInt16) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<ushort>(this.@PropertyUInt16);
return true;
}
if (name == PropertyName.@PropertyUInt32) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<uint>(this.@PropertyUInt32);
return true;
}
if (name == PropertyName.@PropertyUInt64) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<ulong>(this.@PropertyUInt64);
return true;
}
if (name == PropertyName.@PropertySingle) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<float>(this.@PropertySingle);
return true;
}
if (name == PropertyName.@PropertyDouble) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<double>(this.@PropertyDouble);
return true;
}
if (name == PropertyName.@PropertyString) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string>(this.@PropertyString);
return true;
}
if (name == PropertyName.@PropertyVector2) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Vector2>(this.@PropertyVector2);
return true;
}
if (name == PropertyName.@PropertyVector2I) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Vector2I>(this.@PropertyVector2I);
return true;
}
if (name == PropertyName.@PropertyRect2) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Rect2>(this.@PropertyRect2);
return true;
}
if (name == PropertyName.@PropertyRect2I) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Rect2I>(this.@PropertyRect2I);
return true;
}
if (name == PropertyName.@PropertyTransform2D) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Transform2D>(this.@PropertyTransform2D);
return true;
}
if (name == PropertyName.@PropertyVector3) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Vector3>(this.@PropertyVector3);
return true;
}
if (name == PropertyName.@PropertyVector3I) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Vector3I>(this.@PropertyVector3I);
return true;
}
if (name == PropertyName.@PropertyBasis) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Basis>(this.@PropertyBasis);
return true;
}
if (name == PropertyName.@PropertyQuaternion) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Quaternion>(this.@PropertyQuaternion);
return true;
}
if (name == PropertyName.@PropertyTransform3D) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Transform3D>(this.@PropertyTransform3D);
return true;
}
if (name == PropertyName.@PropertyVector4) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Vector4>(this.@PropertyVector4);
return true;
}
if (name == PropertyName.@PropertyVector4I) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Vector4I>(this.@PropertyVector4I);
return true;
}
if (name == PropertyName.@PropertyProjection) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Projection>(this.@PropertyProjection);
return true;
}
if (name == PropertyName.@PropertyAabb) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Aabb>(this.@PropertyAabb);
return true;
}
if (name == PropertyName.@PropertyColor) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Color>(this.@PropertyColor);
return true;
}
if (name == PropertyName.@PropertyPlane) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Plane>(this.@PropertyPlane);
return true;
}
if (name == PropertyName.@PropertyCallable) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Callable>(this.@PropertyCallable);
return true;
}
if (name == PropertyName.@PropertySignal) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Signal>(this.@PropertySignal);
return true;
}
if (name == PropertyName.@PropertyEnum) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::ExportedProperties.MyEnum>(this.@PropertyEnum);
return true;
}
if (name == PropertyName.@PropertyFlagsEnum) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::ExportedProperties.MyFlagsEnum>(this.@PropertyFlagsEnum);
return true;
}
if (name == PropertyName.@PropertyByteArray) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<byte[]>(this.@PropertyByteArray);
return true;
}
if (name == PropertyName.@PropertyInt32Array) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<int[]>(this.@PropertyInt32Array);
return true;
}
if (name == PropertyName.@PropertyInt64Array) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<long[]>(this.@PropertyInt64Array);
return true;
}
if (name == PropertyName.@PropertySingleArray) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<float[]>(this.@PropertySingleArray);
return true;
}
if (name == PropertyName.@PropertyDoubleArray) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<double[]>(this.@PropertyDoubleArray);
return true;
}
if (name == PropertyName.@PropertyStringArray) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string[]>(this.@PropertyStringArray);
return true;
}
if (name == PropertyName.@PropertyStringArrayEnum) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string[]>(this.@PropertyStringArrayEnum);
return true;
}
if (name == PropertyName.@PropertyVector2Array) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Vector2[]>(this.@PropertyVector2Array);
return true;
}
if (name == PropertyName.@PropertyVector3Array) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Vector3[]>(this.@PropertyVector3Array);
return true;
}
if (name == PropertyName.@PropertyColorArray) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Color[]>(this.@PropertyColorArray);
return true;
}
if (name == PropertyName.@PropertyGodotObjectOrDerivedArray) {
value = global::Godot.NativeInterop.VariantUtils.CreateFromSystemArrayOfGodotObject(this.@PropertyGodotObjectOrDerivedArray);
return true;
}
if (name == PropertyName.@field_StringNameArray) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.StringName[]>(this.@field_StringNameArray);
return true;
}
if (name == PropertyName.@field_NodePathArray) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.NodePath[]>(this.@field_NodePathArray);
return true;
}
if (name == PropertyName.@field_RidArray) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Rid[]>(this.@field_RidArray);
return true;
}
if (name == PropertyName.@PropertyVariant) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Variant>(this.@PropertyVariant);
return true;
}
if (name == PropertyName.@PropertyGodotObjectOrDerived) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.GodotObject>(this.@PropertyGodotObjectOrDerived);
return true;
}
if (name == PropertyName.@PropertyGodotResourceTexture) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Texture>(this.@PropertyGodotResourceTexture);
return true;
}
if (name == PropertyName.@PropertyStringName) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.StringName>(this.@PropertyStringName);
return true;
}
if (name == PropertyName.@PropertyNodePath) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.NodePath>(this.@PropertyNodePath);
return true;
}
if (name == PropertyName.@PropertyRid) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Rid>(this.@PropertyRid);
return true;
}
if (name == PropertyName.@PropertyGodotDictionary) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Collections.Dictionary>(this.@PropertyGodotDictionary);
return true;
}
if (name == PropertyName.@PropertyGodotArray) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Collections.Array>(this.@PropertyGodotArray);
return true;
}
if (name == PropertyName.@PropertyGodotGenericDictionary) {
value = global::Godot.NativeInterop.VariantUtils.CreateFromDictionary(this.@PropertyGodotGenericDictionary);
return true;
}
if (name == PropertyName.@PropertyGodotGenericArray) {
value = global::Godot.NativeInterop.VariantUtils.CreateFromArray(this.@PropertyGodotGenericArray);
return true;
}
if (name == PropertyName.@_notGeneratePropertyString) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string>(this.@_notGeneratePropertyString);
return true;
}
if (name == PropertyName.@_notGeneratePropertyInt) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<int>(this.@_notGeneratePropertyInt);
return true;
}
if (name == PropertyName.@_fullPropertyString) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string>(this.@_fullPropertyString);
return true;
}
if (name == PropertyName.@_fullPropertyStringComplex) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string>(this.@_fullPropertyStringComplex);
return true;
}
if (name == PropertyName.@_lamdaPropertyString) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string>(this.@_lamdaPropertyString);
return true;
}
return base.GetGodotClassPropertyValue(name, out value);
}
/// <summary>
/// Get the property information for all the properties declared in this class.
/// This method is used by Godot to register the available properties in the editor.
/// Do not call this method.
/// </summary>
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
internal new static global::System.Collections.Generic.List<global::Godot.Bridge.PropertyInfo> GetGodotPropertyList()
{
var properties = new global::System.Collections.Generic.List<global::Godot.Bridge.PropertyInfo>();
properties.Add(new(type: (global::Godot.Variant.Type)4, name: PropertyName.@_notGeneratePropertyString, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4096, exported: false));
properties.Add(new(type: (global::Godot.Variant.Type)4, name: PropertyName.@NotGenerateComplexLamdaProperty, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)4, name: PropertyName.@NotGenerateLamdaNoFieldProperty, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)4, name: PropertyName.@NotGenerateComplexReturnProperty, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)2, name: PropertyName.@_notGeneratePropertyInt, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4096, exported: false));
properties.Add(new(type: (global::Godot.Variant.Type)4, name: PropertyName.@NotGenerateReturnsProperty, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)4, name: PropertyName.@_fullPropertyString, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4096, exported: false));
properties.Add(new(type: (global::Godot.Variant.Type)4, name: PropertyName.@FullPropertyString, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)4, name: PropertyName.@_fullPropertyStringComplex, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4096, exported: false));
properties.Add(new(type: (global::Godot.Variant.Type)4, name: PropertyName.@FullPropertyString_Complex, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)4, name: PropertyName.@_lamdaPropertyString, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4096, exported: false));
properties.Add(new(type: (global::Godot.Variant.Type)4, name: PropertyName.@LamdaPropertyString, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)1, name: PropertyName.@PropertyBoolean, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)2, name: PropertyName.@PropertyChar, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)2, name: PropertyName.@PropertySByte, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)2, name: PropertyName.@PropertyInt16, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)2, name: PropertyName.@PropertyInt32, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)2, name: PropertyName.@PropertyInt64, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)2, name: PropertyName.@PropertyByte, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)2, name: PropertyName.@PropertyUInt16, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)2, name: PropertyName.@PropertyUInt32, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)2, name: PropertyName.@PropertyUInt64, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)3, name: PropertyName.@PropertySingle, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)3, name: PropertyName.@PropertyDouble, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)4, name: PropertyName.@PropertyString, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)5, name: PropertyName.@PropertyVector2, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)6, name: PropertyName.@PropertyVector2I, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)7, name: PropertyName.@PropertyRect2, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)8, name: PropertyName.@PropertyRect2I, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)11, name: PropertyName.@PropertyTransform2D, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)9, name: PropertyName.@PropertyVector3, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)10, name: PropertyName.@PropertyVector3I, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)17, name: PropertyName.@PropertyBasis, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)15, name: PropertyName.@PropertyQuaternion, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)18, name: PropertyName.@PropertyTransform3D, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)12, name: PropertyName.@PropertyVector4, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)13, name: PropertyName.@PropertyVector4I, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)19, name: PropertyName.@PropertyProjection, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)16, name: PropertyName.@PropertyAabb, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)20, name: PropertyName.@PropertyColor, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)14, name: PropertyName.@PropertyPlane, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)25, name: PropertyName.@PropertyCallable, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)26, name: PropertyName.@PropertySignal, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)2, name: PropertyName.@PropertyEnum, hint: (global::Godot.PropertyHint)2, hintString: "A,B,C", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)2, name: PropertyName.@PropertyFlagsEnum, hint: (global::Godot.PropertyHint)6, hintString: "A:0,B:1,C:2", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)29, name: PropertyName.@PropertyByteArray, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)30, name: PropertyName.@PropertyInt32Array, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)31, name: PropertyName.@PropertyInt64Array, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)32, name: PropertyName.@PropertySingleArray, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)33, name: PropertyName.@PropertyDoubleArray, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)34, name: PropertyName.@PropertyStringArray, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)34, name: PropertyName.@PropertyStringArrayEnum, hint: (global::Godot.PropertyHint)23, hintString: "4/2:A,B,C", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)35, name: PropertyName.@PropertyVector2Array, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)36, name: PropertyName.@PropertyVector3Array, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)37, name: PropertyName.@PropertyColorArray, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)28, name: PropertyName.@PropertyGodotObjectOrDerivedArray, hint: (global::Godot.PropertyHint)23, hintString: "24/0:", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)28, name: PropertyName.@field_StringNameArray, hint: (global::Godot.PropertyHint)23, hintString: "21/0:", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)28, name: PropertyName.@field_NodePathArray, hint: (global::Godot.PropertyHint)23, hintString: "22/0:", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)28, name: PropertyName.@field_RidArray, hint: (global::Godot.PropertyHint)23, hintString: "23/0:", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)0, name: PropertyName.@PropertyVariant, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)135174, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)24, name: PropertyName.@PropertyGodotObjectOrDerived, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)24, name: PropertyName.@PropertyGodotResourceTexture, hint: (global::Godot.PropertyHint)17, hintString: "Texture", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)21, name: PropertyName.@PropertyStringName, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)22, name: PropertyName.@PropertyNodePath, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)23, name: PropertyName.@PropertyRid, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)27, name: PropertyName.@PropertyGodotDictionary, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)28, name: PropertyName.@PropertyGodotArray, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)27, name: PropertyName.@PropertyGodotGenericDictionary, hint: (global::Godot.PropertyHint)23, hintString: "4/0:;1/0:", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)28, name: PropertyName.@PropertyGodotGenericArray, hint: (global::Godot.PropertyHint)23, hintString: "2/0:", usage: (global::Godot.PropertyUsageFlags)4102, exported: true));
return properties;
}
#pragma warning restore CS0109
}

View File

@@ -0,0 +1,147 @@
partial class ExportedProperties
{
#pragma warning disable CS0109 // Disable warning about redundant 'new' keyword
#if TOOLS
/// <summary>
/// Get the default values for all properties declared in this class.
/// This method is used by Godot to determine the value that will be
/// used by the inspector when resetting properties.
/// Do not call this method.
/// </summary>
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
internal new static global::System.Collections.Generic.Dictionary<global::Godot.StringName, global::Godot.Variant> GetGodotPropertyDefaultValues()
{
var values = new global::System.Collections.Generic.Dictionary<global::Godot.StringName, global::Godot.Variant>(64);
string __NotGenerateComplexLamdaProperty_default_value = default;
values.Add(PropertyName.@NotGenerateComplexLamdaProperty, global::Godot.Variant.From<string>(__NotGenerateComplexLamdaProperty_default_value));
string __NotGenerateLamdaNoFieldProperty_default_value = default;
values.Add(PropertyName.@NotGenerateLamdaNoFieldProperty, global::Godot.Variant.From<string>(__NotGenerateLamdaNoFieldProperty_default_value));
string __NotGenerateComplexReturnProperty_default_value = default;
values.Add(PropertyName.@NotGenerateComplexReturnProperty, global::Godot.Variant.From<string>(__NotGenerateComplexReturnProperty_default_value));
string __NotGenerateReturnsProperty_default_value = default;
values.Add(PropertyName.@NotGenerateReturnsProperty, global::Godot.Variant.From<string>(__NotGenerateReturnsProperty_default_value));
string __FullPropertyString_default_value = "FullPropertyString";
values.Add(PropertyName.@FullPropertyString, global::Godot.Variant.From<string>(__FullPropertyString_default_value));
string __FullPropertyString_Complex_default_value = new string("FullPropertyString_Complex") + global::System.Convert.ToInt32("1");
values.Add(PropertyName.@FullPropertyString_Complex, global::Godot.Variant.From<string>(__FullPropertyString_Complex_default_value));
string __LamdaPropertyString_default_value = "LamdaPropertyString";
values.Add(PropertyName.@LamdaPropertyString, global::Godot.Variant.From<string>(__LamdaPropertyString_default_value));
bool __PropertyBoolean_default_value = true;
values.Add(PropertyName.@PropertyBoolean, global::Godot.Variant.From<bool>(__PropertyBoolean_default_value));
char __PropertyChar_default_value = 'f';
values.Add(PropertyName.@PropertyChar, global::Godot.Variant.From<char>(__PropertyChar_default_value));
sbyte __PropertySByte_default_value = 10;
values.Add(PropertyName.@PropertySByte, global::Godot.Variant.From<sbyte>(__PropertySByte_default_value));
short __PropertyInt16_default_value = 10;
values.Add(PropertyName.@PropertyInt16, global::Godot.Variant.From<short>(__PropertyInt16_default_value));
int __PropertyInt32_default_value = 10;
values.Add(PropertyName.@PropertyInt32, global::Godot.Variant.From<int>(__PropertyInt32_default_value));
long __PropertyInt64_default_value = -10_000;
values.Add(PropertyName.@PropertyInt64, global::Godot.Variant.From<long>(__PropertyInt64_default_value));
byte __PropertyByte_default_value = 10;
values.Add(PropertyName.@PropertyByte, global::Godot.Variant.From<byte>(__PropertyByte_default_value));
ushort __PropertyUInt16_default_value = 10;
values.Add(PropertyName.@PropertyUInt16, global::Godot.Variant.From<ushort>(__PropertyUInt16_default_value));
uint __PropertyUInt32_default_value = 10;
values.Add(PropertyName.@PropertyUInt32, global::Godot.Variant.From<uint>(__PropertyUInt32_default_value));
ulong __PropertyUInt64_default_value = 10;
values.Add(PropertyName.@PropertyUInt64, global::Godot.Variant.From<ulong>(__PropertyUInt64_default_value));
float __PropertySingle_default_value = 10;
values.Add(PropertyName.@PropertySingle, global::Godot.Variant.From<float>(__PropertySingle_default_value));
double __PropertyDouble_default_value = 10;
values.Add(PropertyName.@PropertyDouble, global::Godot.Variant.From<double>(__PropertyDouble_default_value));
string __PropertyString_default_value = "foo";
values.Add(PropertyName.@PropertyString, global::Godot.Variant.From<string>(__PropertyString_default_value));
global::Godot.Vector2 __PropertyVector2_default_value = new(10f, 10f);
values.Add(PropertyName.@PropertyVector2, global::Godot.Variant.From<global::Godot.Vector2>(__PropertyVector2_default_value));
global::Godot.Vector2I __PropertyVector2I_default_value = global::Godot.Vector2I.Up;
values.Add(PropertyName.@PropertyVector2I, global::Godot.Variant.From<global::Godot.Vector2I>(__PropertyVector2I_default_value));
global::Godot.Rect2 __PropertyRect2_default_value = new(new global::Godot.Vector2(10f, 10f), new global::Godot.Vector2(10f, 10f));
values.Add(PropertyName.@PropertyRect2, global::Godot.Variant.From<global::Godot.Rect2>(__PropertyRect2_default_value));
global::Godot.Rect2I __PropertyRect2I_default_value = new(new global::Godot.Vector2I(10, 10), new global::Godot.Vector2I(10, 10));
values.Add(PropertyName.@PropertyRect2I, global::Godot.Variant.From<global::Godot.Rect2I>(__PropertyRect2I_default_value));
global::Godot.Transform2D __PropertyTransform2D_default_value = global::Godot.Transform2D.Identity;
values.Add(PropertyName.@PropertyTransform2D, global::Godot.Variant.From<global::Godot.Transform2D>(__PropertyTransform2D_default_value));
global::Godot.Vector3 __PropertyVector3_default_value = new(10f, 10f, 10f);
values.Add(PropertyName.@PropertyVector3, global::Godot.Variant.From<global::Godot.Vector3>(__PropertyVector3_default_value));
global::Godot.Vector3I __PropertyVector3I_default_value = global::Godot.Vector3I.Back;
values.Add(PropertyName.@PropertyVector3I, global::Godot.Variant.From<global::Godot.Vector3I>(__PropertyVector3I_default_value));
global::Godot.Basis __PropertyBasis_default_value = new global::Godot.Basis(global::Godot.Quaternion.Identity);
values.Add(PropertyName.@PropertyBasis, global::Godot.Variant.From<global::Godot.Basis>(__PropertyBasis_default_value));
global::Godot.Quaternion __PropertyQuaternion_default_value = new global::Godot.Quaternion(global::Godot.Basis.Identity);
values.Add(PropertyName.@PropertyQuaternion, global::Godot.Variant.From<global::Godot.Quaternion>(__PropertyQuaternion_default_value));
global::Godot.Transform3D __PropertyTransform3D_default_value = global::Godot.Transform3D.Identity;
values.Add(PropertyName.@PropertyTransform3D, global::Godot.Variant.From<global::Godot.Transform3D>(__PropertyTransform3D_default_value));
global::Godot.Vector4 __PropertyVector4_default_value = new(10f, 10f, 10f, 10f);
values.Add(PropertyName.@PropertyVector4, global::Godot.Variant.From<global::Godot.Vector4>(__PropertyVector4_default_value));
global::Godot.Vector4I __PropertyVector4I_default_value = global::Godot.Vector4I.One;
values.Add(PropertyName.@PropertyVector4I, global::Godot.Variant.From<global::Godot.Vector4I>(__PropertyVector4I_default_value));
global::Godot.Projection __PropertyProjection_default_value = global::Godot.Projection.Identity;
values.Add(PropertyName.@PropertyProjection, global::Godot.Variant.From<global::Godot.Projection>(__PropertyProjection_default_value));
global::Godot.Aabb __PropertyAabb_default_value = new global::Godot.Aabb(10f, 10f, 10f, new global::Godot.Vector3(1f, 1f, 1f));
values.Add(PropertyName.@PropertyAabb, global::Godot.Variant.From<global::Godot.Aabb>(__PropertyAabb_default_value));
global::Godot.Color __PropertyColor_default_value = global::Godot.Colors.Aquamarine;
values.Add(PropertyName.@PropertyColor, global::Godot.Variant.From<global::Godot.Color>(__PropertyColor_default_value));
global::Godot.Plane __PropertyPlane_default_value = global::Godot.Plane.PlaneXZ;
values.Add(PropertyName.@PropertyPlane, global::Godot.Variant.From<global::Godot.Plane>(__PropertyPlane_default_value));
global::Godot.Callable __PropertyCallable_default_value = new global::Godot.Callable(global::Godot.Engine.GetMainLoop(), "_process");
values.Add(PropertyName.@PropertyCallable, global::Godot.Variant.From<global::Godot.Callable>(__PropertyCallable_default_value));
global::Godot.Signal __PropertySignal_default_value = new global::Godot.Signal(global::Godot.Engine.GetMainLoop(), "Propertylist_changed");
values.Add(PropertyName.@PropertySignal, global::Godot.Variant.From<global::Godot.Signal>(__PropertySignal_default_value));
global::ExportedProperties.MyEnum __PropertyEnum_default_value = global::ExportedProperties.MyEnum.C;
values.Add(PropertyName.@PropertyEnum, global::Godot.Variant.From<global::ExportedProperties.MyEnum>(__PropertyEnum_default_value));
global::ExportedProperties.MyFlagsEnum __PropertyFlagsEnum_default_value = global::ExportedProperties.MyFlagsEnum.C;
values.Add(PropertyName.@PropertyFlagsEnum, global::Godot.Variant.From<global::ExportedProperties.MyFlagsEnum>(__PropertyFlagsEnum_default_value));
byte[] __PropertyByteArray_default_value = { 0, 1, 2, 3, 4, 5, 6 };
values.Add(PropertyName.@PropertyByteArray, global::Godot.Variant.From<byte[]>(__PropertyByteArray_default_value));
int[] __PropertyInt32Array_default_value = { 0, 1, 2, 3, 4, 5, 6 };
values.Add(PropertyName.@PropertyInt32Array, global::Godot.Variant.From<int[]>(__PropertyInt32Array_default_value));
long[] __PropertyInt64Array_default_value = { 0, 1, 2, 3, 4, 5, 6 };
values.Add(PropertyName.@PropertyInt64Array, global::Godot.Variant.From<long[]>(__PropertyInt64Array_default_value));
float[] __PropertySingleArray_default_value = { 0f, 1f, 2f, 3f, 4f, 5f, 6f };
values.Add(PropertyName.@PropertySingleArray, global::Godot.Variant.From<float[]>(__PropertySingleArray_default_value));
double[] __PropertyDoubleArray_default_value = { 0d, 1d, 2d, 3d, 4d, 5d, 6d };
values.Add(PropertyName.@PropertyDoubleArray, global::Godot.Variant.From<double[]>(__PropertyDoubleArray_default_value));
string[] __PropertyStringArray_default_value = { "foo", "bar" };
values.Add(PropertyName.@PropertyStringArray, global::Godot.Variant.From<string[]>(__PropertyStringArray_default_value));
string[] __PropertyStringArrayEnum_default_value = { "foo", "bar" };
values.Add(PropertyName.@PropertyStringArrayEnum, global::Godot.Variant.From<string[]>(__PropertyStringArrayEnum_default_value));
global::Godot.Vector2[] __PropertyVector2Array_default_value = { global::Godot.Vector2.Up, global::Godot.Vector2.Down, global::Godot.Vector2.Left, global::Godot.Vector2.Right };
values.Add(PropertyName.@PropertyVector2Array, global::Godot.Variant.From<global::Godot.Vector2[]>(__PropertyVector2Array_default_value));
global::Godot.Vector3[] __PropertyVector3Array_default_value = { global::Godot.Vector3.Up, global::Godot.Vector3.Down, global::Godot.Vector3.Left, global::Godot.Vector3.Right };
values.Add(PropertyName.@PropertyVector3Array, global::Godot.Variant.From<global::Godot.Vector3[]>(__PropertyVector3Array_default_value));
global::Godot.Color[] __PropertyColorArray_default_value = { global::Godot.Colors.Aqua, global::Godot.Colors.Aquamarine, global::Godot.Colors.Azure, global::Godot.Colors.Beige };
values.Add(PropertyName.@PropertyColorArray, global::Godot.Variant.From<global::Godot.Color[]>(__PropertyColorArray_default_value));
global::Godot.GodotObject[] __PropertyGodotObjectOrDerivedArray_default_value = { null };
values.Add(PropertyName.@PropertyGodotObjectOrDerivedArray, global::Godot.Variant.CreateFrom(__PropertyGodotObjectOrDerivedArray_default_value));
global::Godot.StringName[] __field_StringNameArray_default_value = { "foo", "bar" };
values.Add(PropertyName.@field_StringNameArray, global::Godot.Variant.From<global::Godot.StringName[]>(__field_StringNameArray_default_value));
global::Godot.NodePath[] __field_NodePathArray_default_value = { "foo", "bar" };
values.Add(PropertyName.@field_NodePathArray, global::Godot.Variant.From<global::Godot.NodePath[]>(__field_NodePathArray_default_value));
global::Godot.Rid[] __field_RidArray_default_value = { default, default, default };
values.Add(PropertyName.@field_RidArray, global::Godot.Variant.From<global::Godot.Rid[]>(__field_RidArray_default_value));
global::Godot.Variant __PropertyVariant_default_value = "foo";
values.Add(PropertyName.@PropertyVariant, global::Godot.Variant.From<global::Godot.Variant>(__PropertyVariant_default_value));
global::Godot.GodotObject __PropertyGodotObjectOrDerived_default_value = default;
values.Add(PropertyName.@PropertyGodotObjectOrDerived, global::Godot.Variant.From<global::Godot.GodotObject>(__PropertyGodotObjectOrDerived_default_value));
global::Godot.Texture __PropertyGodotResourceTexture_default_value = default;
values.Add(PropertyName.@PropertyGodotResourceTexture, global::Godot.Variant.From<global::Godot.Texture>(__PropertyGodotResourceTexture_default_value));
global::Godot.StringName __PropertyStringName_default_value = new global::Godot.StringName("foo");
values.Add(PropertyName.@PropertyStringName, global::Godot.Variant.From<global::Godot.StringName>(__PropertyStringName_default_value));
global::Godot.NodePath __PropertyNodePath_default_value = new global::Godot.NodePath("foo");
values.Add(PropertyName.@PropertyNodePath, global::Godot.Variant.From<global::Godot.NodePath>(__PropertyNodePath_default_value));
global::Godot.Rid __PropertyRid_default_value = default;
values.Add(PropertyName.@PropertyRid, global::Godot.Variant.From<global::Godot.Rid>(__PropertyRid_default_value));
global::Godot.Collections.Dictionary __PropertyGodotDictionary_default_value = new() { { "foo", 10 }, { global::Godot.Vector2.Up, global::Godot.Colors.Chocolate } };
values.Add(PropertyName.@PropertyGodotDictionary, global::Godot.Variant.From<global::Godot.Collections.Dictionary>(__PropertyGodotDictionary_default_value));
global::Godot.Collections.Array __PropertyGodotArray_default_value = new() { "foo", 10, global::Godot.Vector2.Up, global::Godot.Colors.Chocolate };
values.Add(PropertyName.@PropertyGodotArray, global::Godot.Variant.From<global::Godot.Collections.Array>(__PropertyGodotArray_default_value));
global::Godot.Collections.Dictionary<string, bool> __PropertyGodotGenericDictionary_default_value = new() { { "foo", true }, { "bar", false } };
values.Add(PropertyName.@PropertyGodotGenericDictionary, global::Godot.Variant.CreateFrom(__PropertyGodotGenericDictionary_default_value));
global::Godot.Collections.Array<int> __PropertyGodotGenericArray_default_value = new() { 0, 1, 2, 3, 4, 5, 6 };
values.Add(PropertyName.@PropertyGodotGenericArray, global::Godot.Variant.CreateFrom(__PropertyGodotGenericArray_default_value));
return values;
}
#endif // TOOLS
#pragma warning restore CS0109
}

View File

@@ -0,0 +1,48 @@
using Godot;
using Godot.NativeInterop;
partial class ExportedToolButtons
{
#pragma warning disable CS0109 // Disable warning about redundant 'new' keyword
/// <summary>
/// Cached StringNames for the properties and fields contained in this class, for fast lookup.
/// </summary>
public new class PropertyName : global::Godot.GodotObject.PropertyName {
/// <summary>
/// Cached name for the 'MyButton1' property.
/// </summary>
public new static readonly global::Godot.StringName @MyButton1 = "MyButton1";
/// <summary>
/// Cached name for the 'MyButton2' property.
/// </summary>
public new static readonly global::Godot.StringName @MyButton2 = "MyButton2";
}
/// <inheritdoc/>
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
protected override bool GetGodotClassPropertyValue(in godot_string_name name, out godot_variant value)
{
if (name == PropertyName.@MyButton1) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Callable>(this.@MyButton1);
return true;
}
if (name == PropertyName.@MyButton2) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Callable>(this.@MyButton2);
return true;
}
return base.GetGodotClassPropertyValue(name, out value);
}
/// <summary>
/// Get the property information for all the properties declared in this class.
/// This method is used by Godot to register the available properties in the editor.
/// Do not call this method.
/// </summary>
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
internal new static global::System.Collections.Generic.List<global::Godot.Bridge.PropertyInfo> GetGodotPropertyList()
{
var properties = new global::System.Collections.Generic.List<global::Godot.Bridge.PropertyInfo>();
properties.Add(new(type: (global::Godot.Variant.Type)25, name: PropertyName.@MyButton1, hint: (global::Godot.PropertyHint)39, hintString: "Click me!", usage: (global::Godot.PropertyUsageFlags)4, exported: true));
properties.Add(new(type: (global::Godot.Variant.Type)25, name: PropertyName.@MyButton2, hint: (global::Godot.PropertyHint)39, hintString: "Click me!,ColorRect", usage: (global::Godot.PropertyUsageFlags)4, exported: true));
return properties;
}
#pragma warning restore CS0109
}

View File

@@ -0,0 +1,5 @@
using Godot;
[ScriptPathAttribute("res://Foo.cs")]
partial class Foo
{
}

View File

@@ -0,0 +1,5 @@
using Godot;
[ScriptPathAttribute("res://Generic.cs")]
partial class Generic<T>
{
}

View File

@@ -0,0 +1,16 @@
using Godot;
using Godot.NativeInterop;
partial class GenericClass<T>
{
partial class NestedClass
{
#pragma warning disable CS0109 // Disable warning about redundant 'new' keyword
/// <summary>
/// Cached StringNames for the methods contained in this class, for fast lookup.
/// </summary>
public new class MethodName : global::Godot.GodotObject.MethodName {
}
#pragma warning restore CS0109
}
}

View File

@@ -0,0 +1,61 @@
using Godot;
using Godot.NativeInterop;
partial class Methods
{
#pragma warning disable CS0109 // Disable warning about redundant 'new' keyword
/// <summary>
/// Cached StringNames for the methods contained in this class, for fast lookup.
/// </summary>
public new class MethodName : global::Godot.GodotObject.MethodName {
/// <summary>
/// Cached name for the 'MethodWithOverload' method.
/// </summary>
public new static readonly global::Godot.StringName @MethodWithOverload = "MethodWithOverload";
}
/// <summary>
/// Get the method information for all the methods declared in this class.
/// This method is used by Godot to register the available methods in the editor.
/// Do not call this method.
/// </summary>
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
internal new static global::System.Collections.Generic.List<global::Godot.Bridge.MethodInfo> GetGodotMethodList()
{
var methods = new global::System.Collections.Generic.List<global::Godot.Bridge.MethodInfo>(3);
methods.Add(new(name: MethodName.@MethodWithOverload, returnVal: new(type: (global::Godot.Variant.Type)0, name: "", hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)6, exported: false), flags: (global::Godot.MethodFlags)1, arguments: null, defaultArguments: null));
methods.Add(new(name: MethodName.@MethodWithOverload, returnVal: new(type: (global::Godot.Variant.Type)0, name: "", hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)6, exported: false), flags: (global::Godot.MethodFlags)1, arguments: new() { new(type: (global::Godot.Variant.Type)2, name: "a", hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)6, exported: false), }, defaultArguments: null));
methods.Add(new(name: MethodName.@MethodWithOverload, returnVal: new(type: (global::Godot.Variant.Type)0, name: "", hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)6, exported: false), flags: (global::Godot.MethodFlags)1, arguments: new() { new(type: (global::Godot.Variant.Type)2, name: "a", hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)6, exported: false), new(type: (global::Godot.Variant.Type)2, name: "b", hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)6, exported: false), }, defaultArguments: null));
return methods;
}
#pragma warning restore CS0109
/// <inheritdoc/>
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
protected override bool InvokeGodotClassMethod(in godot_string_name method, NativeVariantPtrArgs args, out godot_variant ret)
{
if (method == MethodName.@MethodWithOverload && args.Count == 0) {
@MethodWithOverload();
ret = default;
return true;
}
if (method == MethodName.@MethodWithOverload && args.Count == 1) {
@MethodWithOverload(global::Godot.NativeInterop.VariantUtils.ConvertTo<int>(args[0]));
ret = default;
return true;
}
if (method == MethodName.@MethodWithOverload && args.Count == 2) {
@MethodWithOverload(global::Godot.NativeInterop.VariantUtils.ConvertTo<int>(args[0]), global::Godot.NativeInterop.VariantUtils.ConvertTo<int>(args[1]));
ret = default;
return true;
}
return base.InvokeGodotClassMethod(method, args, out ret);
}
/// <inheritdoc/>
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
protected override bool HasGodotClassMethod(in godot_string_name method)
{
if (method == MethodName.@MethodWithOverload) {
return true;
}
return base.HasGodotClassMethod(method);
}
}

View File

@@ -0,0 +1,94 @@
using Godot;
using Godot.NativeInterop;
partial class MixedReadOnlyWriteOnly
{
#pragma warning disable CS0109 // Disable warning about redundant 'new' keyword
/// <summary>
/// Cached StringNames for the properties and fields contained in this class, for fast lookup.
/// </summary>
public new class PropertyName : global::Godot.GodotObject.PropertyName {
/// <summary>
/// Cached name for the 'ReadOnlyAutoProperty' property.
/// </summary>
public new static readonly global::Godot.StringName @ReadOnlyAutoProperty = "ReadOnlyAutoProperty";
/// <summary>
/// Cached name for the 'ReadOnlyProperty' property.
/// </summary>
public new static readonly global::Godot.StringName @ReadOnlyProperty = "ReadOnlyProperty";
/// <summary>
/// Cached name for the 'InitOnlyAutoProperty' property.
/// </summary>
public new static readonly global::Godot.StringName @InitOnlyAutoProperty = "InitOnlyAutoProperty";
/// <summary>
/// Cached name for the 'WriteOnlyProperty' property.
/// </summary>
public new static readonly global::Godot.StringName @WriteOnlyProperty = "WriteOnlyProperty";
/// <summary>
/// Cached name for the 'ReadOnlyField' field.
/// </summary>
public new static readonly global::Godot.StringName @ReadOnlyField = "ReadOnlyField";
/// <summary>
/// Cached name for the '_writeOnlyBackingField' field.
/// </summary>
public new static readonly global::Godot.StringName @_writeOnlyBackingField = "_writeOnlyBackingField";
}
/// <inheritdoc/>
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
protected override bool SetGodotClassPropertyValue(in godot_string_name name, in godot_variant value)
{
if (name == PropertyName.@WriteOnlyProperty) {
this.@WriteOnlyProperty = global::Godot.NativeInterop.VariantUtils.ConvertTo<bool>(value);
return true;
}
if (name == PropertyName.@_writeOnlyBackingField) {
this.@_writeOnlyBackingField = global::Godot.NativeInterop.VariantUtils.ConvertTo<bool>(value);
return true;
}
return base.SetGodotClassPropertyValue(name, value);
}
/// <inheritdoc/>
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
protected override bool GetGodotClassPropertyValue(in godot_string_name name, out godot_variant value)
{
if (name == PropertyName.@ReadOnlyAutoProperty) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string>(this.@ReadOnlyAutoProperty);
return true;
}
if (name == PropertyName.@ReadOnlyProperty) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string>(this.@ReadOnlyProperty);
return true;
}
if (name == PropertyName.@InitOnlyAutoProperty) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string>(this.@InitOnlyAutoProperty);
return true;
}
if (name == PropertyName.@ReadOnlyField) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string>(this.@ReadOnlyField);
return true;
}
if (name == PropertyName.@_writeOnlyBackingField) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<bool>(this.@_writeOnlyBackingField);
return true;
}
return base.GetGodotClassPropertyValue(name, out value);
}
/// <summary>
/// Get the property information for all the properties declared in this class.
/// This method is used by Godot to register the available properties in the editor.
/// Do not call this method.
/// </summary>
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
internal new static global::System.Collections.Generic.List<global::Godot.Bridge.PropertyInfo> GetGodotPropertyList()
{
var properties = new global::System.Collections.Generic.List<global::Godot.Bridge.PropertyInfo>();
properties.Add(new(type: (global::Godot.Variant.Type)4, name: PropertyName.@ReadOnlyField, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4096, exported: false));
properties.Add(new(type: (global::Godot.Variant.Type)4, name: PropertyName.@ReadOnlyAutoProperty, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4096, exported: false));
properties.Add(new(type: (global::Godot.Variant.Type)4, name: PropertyName.@ReadOnlyProperty, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4096, exported: false));
properties.Add(new(type: (global::Godot.Variant.Type)4, name: PropertyName.@InitOnlyAutoProperty, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4096, exported: false));
properties.Add(new(type: (global::Godot.Variant.Type)1, name: PropertyName.@_writeOnlyBackingField, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4096, exported: false));
properties.Add(new(type: (global::Godot.Variant.Type)1, name: PropertyName.@WriteOnlyProperty, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4096, exported: false));
return properties;
}
#pragma warning restore CS0109
}

View File

@@ -0,0 +1,9 @@
using Godot;
namespace NamespaceA {
[ScriptPathAttribute("res://SameName.cs")]
partial class SameName
{
}
}

View File

@@ -0,0 +1,52 @@
using Godot;
using Godot.NativeInterop;
partial struct OuterClass
{
partial class NestedClass
{
#pragma warning disable CS0109 // Disable warning about redundant 'new' keyword
/// <summary>
/// Cached StringNames for the methods contained in this class, for fast lookup.
/// </summary>
public new class MethodName : global::Godot.RefCounted.MethodName {
/// <summary>
/// Cached name for the '_Get' method.
/// </summary>
public new static readonly global::Godot.StringName @_Get = "_Get";
}
/// <summary>
/// Get the method information for all the methods declared in this class.
/// This method is used by Godot to register the available methods in the editor.
/// Do not call this method.
/// </summary>
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
internal new static global::System.Collections.Generic.List<global::Godot.Bridge.MethodInfo> GetGodotMethodList()
{
var methods = new global::System.Collections.Generic.List<global::Godot.Bridge.MethodInfo>(1);
methods.Add(new(name: MethodName.@_Get, returnVal: new(type: (global::Godot.Variant.Type)0, name: "", hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)131078, exported: false), flags: (global::Godot.MethodFlags)1, arguments: new() { new(type: (global::Godot.Variant.Type)21, name: "property", hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)6, exported: false), }, defaultArguments: null));
return methods;
}
#pragma warning restore CS0109
/// <inheritdoc/>
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
protected override bool InvokeGodotClassMethod(in godot_string_name method, NativeVariantPtrArgs args, out godot_variant ret)
{
if (method == MethodName.@_Get && args.Count == 1) {
var callRet = @_Get(global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.StringName>(args[0]));
ret = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Variant>(callRet);
return true;
}
return base.InvokeGodotClassMethod(method, args, out ret);
}
/// <inheritdoc/>
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
protected override bool HasGodotClassMethod(in godot_string_name method)
{
if (method == MethodName.@_Get) {
return true;
}
return base.HasGodotClassMethod(method);
}
}
}

View File

@@ -0,0 +1,15 @@
using Godot;
using Godot.NativeInterop;
partial struct OuterClass
{
partial class NestedClass
{
#pragma warning disable CS0109 // Disable warning about redundant 'new' keyword
/// <summary>
/// Cached StringNames for the properties and fields contained in this class, for fast lookup.
/// </summary>
public new class PropertyName : global::Godot.RefCounted.PropertyName {
}
}
}

View File

@@ -0,0 +1,21 @@
using Godot;
using Godot.NativeInterop;
partial struct OuterClass
{
partial class NestedClass
{
/// <inheritdoc/>
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
protected override void SaveGodotObjectData(global::Godot.Bridge.GodotSerializationInfo info)
{
base.SaveGodotObjectData(info);
}
/// <inheritdoc/>
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
protected override void RestoreGodotObjectData(global::Godot.Bridge.GodotSerializationInfo info)
{
base.RestoreGodotObjectData(info);
}
}
}

View File

@@ -0,0 +1,62 @@
using Godot;
using Godot.NativeInterop;
partial class ScriptBoilerplate
{
#pragma warning disable CS0109 // Disable warning about redundant 'new' keyword
/// <summary>
/// Cached StringNames for the methods contained in this class, for fast lookup.
/// </summary>
public new class MethodName : global::Godot.Node.MethodName {
/// <summary>
/// Cached name for the '_Process' method.
/// </summary>
public new static readonly global::Godot.StringName @_Process = "_Process";
/// <summary>
/// Cached name for the 'Bazz' method.
/// </summary>
public new static readonly global::Godot.StringName @Bazz = "Bazz";
}
/// <summary>
/// Get the method information for all the methods declared in this class.
/// This method is used by Godot to register the available methods in the editor.
/// Do not call this method.
/// </summary>
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
internal new static global::System.Collections.Generic.List<global::Godot.Bridge.MethodInfo> GetGodotMethodList()
{
var methods = new global::System.Collections.Generic.List<global::Godot.Bridge.MethodInfo>(2);
methods.Add(new(name: MethodName.@_Process, returnVal: new(type: (global::Godot.Variant.Type)0, name: "", hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)6, exported: false), flags: (global::Godot.MethodFlags)1, arguments: new() { new(type: (global::Godot.Variant.Type)3, name: "delta", hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)6, exported: false), }, defaultArguments: null));
methods.Add(new(name: MethodName.@Bazz, returnVal: new(type: (global::Godot.Variant.Type)2, name: "", hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)6, exported: false), flags: (global::Godot.MethodFlags)1, arguments: new() { new(type: (global::Godot.Variant.Type)21, name: "name", hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)6, exported: false), }, defaultArguments: null));
return methods;
}
#pragma warning restore CS0109
/// <inheritdoc/>
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
protected override bool InvokeGodotClassMethod(in godot_string_name method, NativeVariantPtrArgs args, out godot_variant ret)
{
if (method == MethodName.@_Process && args.Count == 1) {
@_Process(global::Godot.NativeInterop.VariantUtils.ConvertTo<double>(args[0]));
ret = default;
return true;
}
if (method == MethodName.@Bazz && args.Count == 1) {
var callRet = @Bazz(global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.StringName>(args[0]));
ret = global::Godot.NativeInterop.VariantUtils.CreateFrom<int>(callRet);
return true;
}
return base.InvokeGodotClassMethod(method, args, out ret);
}
/// <inheritdoc/>
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
protected override bool HasGodotClassMethod(in godot_string_name method)
{
if (method == MethodName.@_Process) {
return true;
}
if (method == MethodName.@Bazz) {
return true;
}
return base.HasGodotClassMethod(method);
}
}

View File

@@ -0,0 +1,5 @@
using Godot;
[ScriptPathAttribute("res://ScriptBoilerplate.cs")]
partial class ScriptBoilerplate
{
}

View File

@@ -0,0 +1,62 @@
using Godot;
using Godot.NativeInterop;
partial class ScriptBoilerplate
{
#pragma warning disable CS0109 // Disable warning about redundant 'new' keyword
/// <summary>
/// Cached StringNames for the properties and fields contained in this class, for fast lookup.
/// </summary>
public new class PropertyName : global::Godot.Node.PropertyName {
/// <summary>
/// Cached name for the '_nodePath' field.
/// </summary>
public new static readonly global::Godot.StringName @_nodePath = "_nodePath";
/// <summary>
/// Cached name for the '_velocity' field.
/// </summary>
public new static readonly global::Godot.StringName @_velocity = "_velocity";
}
/// <inheritdoc/>
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
protected override bool SetGodotClassPropertyValue(in godot_string_name name, in godot_variant value)
{
if (name == PropertyName.@_nodePath) {
this.@_nodePath = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.NodePath>(value);
return true;
}
if (name == PropertyName.@_velocity) {
this.@_velocity = global::Godot.NativeInterop.VariantUtils.ConvertTo<int>(value);
return true;
}
return base.SetGodotClassPropertyValue(name, value);
}
/// <inheritdoc/>
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
protected override bool GetGodotClassPropertyValue(in godot_string_name name, out godot_variant value)
{
if (name == PropertyName.@_nodePath) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.NodePath>(this.@_nodePath);
return true;
}
if (name == PropertyName.@_velocity) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<int>(this.@_velocity);
return true;
}
return base.GetGodotClassPropertyValue(name, out value);
}
/// <summary>
/// Get the property information for all the properties declared in this class.
/// This method is used by Godot to register the available properties in the editor.
/// Do not call this method.
/// </summary>
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
internal new static global::System.Collections.Generic.List<global::Godot.Bridge.PropertyInfo> GetGodotPropertyList()
{
var properties = new global::System.Collections.Generic.List<global::Godot.Bridge.PropertyInfo>();
properties.Add(new(type: (global::Godot.Variant.Type)22, name: PropertyName.@_nodePath, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4096, exported: false));
properties.Add(new(type: (global::Godot.Variant.Type)2, name: PropertyName.@_velocity, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4096, exported: false));
return properties;
}
#pragma warning restore CS0109
}

Some files were not shown because too many files have changed in this diff Show More