Update C# bindings

This commit is contained in:
Cory Petkovsek 2025-11-30 18:23:12 +07:00
parent e477c161ad
commit a6aec270d2
4 changed files with 45 additions and 14 deletions

View File

@ -165,7 +165,7 @@ public partial class Terrain3D : Node3D
public new static readonly StringName GiMode = "gi_mode";
public new static readonly StringName CullMargin = "cull_margin";
public new static readonly StringName FreeEditorTextures = "free_editor_textures";
public new static readonly StringName ShowInstances = "show_instances";
public new static readonly StringName InstancerMode = "instancer_mode";
public new static readonly StringName ShowRegionGrid = "show_region_grid";
public new static readonly StringName ShowInstancerGrid = "show_instancer_grid";
public new static readonly StringName ShowVertexGrid = "show_vertex_grid";
@ -369,10 +369,10 @@ public partial class Terrain3D : Node3D
set => Set(GDExtensionPropertyName.FreeEditorTextures, value);
}
public new bool ShowInstances
public new Terrain3DInstancer.InstancerMode InstancerMode
{
get => Get(GDExtensionPropertyName.ShowInstances).As<bool>();
set => Set(GDExtensionPropertyName.ShowInstances, value);
get => Get(GDExtensionPropertyName.InstancerMode).As<Terrain3DInstancer.InstancerMode>();
set => Set(GDExtensionPropertyName.InstancerMode, Variant.From(value));
}
public new bool ShowRegionGrid

View File

@ -140,8 +140,8 @@ public partial class Terrain3DAssets : Resource
public new static class GDExtensionMethodName
{
public new static readonly StringName SetTexture = "set_texture";
public new static readonly StringName GetTexture = "get_texture";
public new static readonly StringName SetTextureAsset = "set_texture_asset";
public new static readonly StringName GetTextureAsset = "get_texture_asset";
public new static readonly StringName GetTextureCount = "get_texture_count";
public new static readonly StringName GetAlbedoArrayRid = "get_albedo_array_rid";
public new static readonly StringName GetNormalArrayRid = "get_normal_array_rid";
@ -162,11 +162,11 @@ public partial class Terrain3DAssets : Resource
public new static readonly StringName Save = "save";
}
public new void SetTexture(long id, Terrain3DTextureAsset texture) =>
Call(GDExtensionMethodName.SetTexture, [id, texture]);
public new void SetTextureAsset(long id, Terrain3DTextureAsset texture) =>
Call(GDExtensionMethodName.SetTextureAsset, [id, texture]);
public new Terrain3DTextureAsset GetTexture(long id) =>
Terrain3DTextureAsset.Bind(Call(GDExtensionMethodName.GetTexture, [id]).As<Resource>());
public new Terrain3DTextureAsset GetTextureAsset(long id) =>
Terrain3DTextureAsset.Bind(Call(GDExtensionMethodName.GetTextureAsset, [id]).As<Resource>());
public new long GetTextureCount() =>
Call(GDExtensionMethodName.GetTextureCount, []).As<long>();

View File

@ -60,11 +60,29 @@ public partial class Terrain3DInstancer : GodotObject
/// <returns>The wrapper instance linked to the underlying GDExtension "Terrain3DInstancer" type.</returns>
public new static Terrain3DInstancer Instantiate() => Bind(ClassDB.Instantiate(NativeName).As<GodotObject>());
public enum InstancerMode
{
Normal = 1,
Disabled = 0,
}
public new static class GDExtensionPropertyName
{
public new static readonly StringName Mode = "mode";
}
public new Terrain3DInstancer.InstancerMode Mode
{
get => Get(GDExtensionPropertyName.Mode).As<Terrain3DInstancer.InstancerMode>();
set => Set(GDExtensionPropertyName.Mode, Variant.From(value));
}
public new static class GDExtensionMethodName
{
public new static readonly StringName ClearByMesh = "clear_by_mesh";
public new static readonly StringName ClearByLocation = "clear_by_location";
public new static readonly StringName ClearByRegion = "clear_by_region";
public new static readonly StringName IsEnabled = "is_enabled";
public new static readonly StringName AddInstances = "add_instances";
public new static readonly StringName RemoveInstances = "remove_instances";
public new static readonly StringName AddMultimesh = "add_multimesh";
@ -75,7 +93,6 @@ public partial class Terrain3DInstancer : GodotObject
public new static readonly StringName GetClosestMeshId = "get_closest_mesh_id";
public new static readonly StringName UpdateMmis = "update_mmis";
public new static readonly StringName SwapIds = "swap_ids";
public new static readonly StringName DumpMmis = "dump_mmis";
}
public new void ClearByMesh(long meshId) =>
@ -87,6 +104,9 @@ public partial class Terrain3DInstancer : GodotObject
public new void ClearByRegion(Terrain3DRegion region, long meshId) =>
Call(GDExtensionMethodName.ClearByRegion, [region, meshId]);
public new bool IsEnabled() =>
Call(GDExtensionMethodName.IsEnabled, []).As<bool>();
public new void AddInstances(Vector3 globalPosition, Godot.Collections.Dictionary @params) =>
Call(GDExtensionMethodName.AddInstances, [globalPosition, @params]);
@ -117,7 +137,4 @@ public partial class Terrain3DInstancer : GodotObject
public new void SwapIds(long srcId, long destId) =>
Call(GDExtensionMethodName.SwapIds, [srcId, destId]);
public new void DumpMmis() =>
Call(GDExtensionMethodName.DumpMmis, []);
}

View File

@ -177,9 +177,11 @@ public partial class Terrain3DMeshAsset : Resource
public new static readonly StringName Id = "id";
public new static readonly StringName Enabled = "enabled";
public new static readonly StringName SceneFile = "scene_file";
public new static readonly StringName GeneratedType = "generated_type";
public new static readonly StringName HeightOffset = "height_offset";
public new static readonly StringName Density = "density";
public new static readonly StringName CastShadows = "cast_shadows";
public new static readonly StringName VisibilityLayers = "visibility_layers";
public new static readonly StringName MaterialOverride = "material_override";
public new static readonly StringName MaterialOverlay = "material_overlay";
public new static readonly StringName GeneratedFaces = "generated_faces";
@ -225,6 +227,12 @@ public partial class Terrain3DMeshAsset : Resource
set => Set(GDExtensionPropertyName.SceneFile, value);
}
public new Variant GeneratedType
{
get => Get(GDExtensionPropertyName.GeneratedType).As<Variant>();
set => Set(GDExtensionPropertyName.GeneratedType, value);
}
public new double HeightOffset
{
get => Get(GDExtensionPropertyName.HeightOffset).As<double>();
@ -243,6 +251,12 @@ public partial class Terrain3DMeshAsset : Resource
set => Set(GDExtensionPropertyName.CastShadows, value);
}
public new long VisibilityLayers
{
get => Get(GDExtensionPropertyName.VisibilityLayers).As<long>();
set => Set(GDExtensionPropertyName.VisibilityLayers, value);
}
public new Material MaterialOverride
{
get => Get(GDExtensionPropertyName.MaterialOverride).As<Material>();