Skip to content

[C#] ResourceUid is broken. #83237

Closed
@zaevi

Description

Godot version

4.2.beta1

System information

Godot v4.2.beta.mono (ee118e7) - Windows 10.0.22621 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 4090 (NVIDIA; 31.0.15.3742) - 13th Gen Intel(R) Core(TM) i7-13700F (24 Threads)

Issue description

Calling methods of ResourceUid will cause error:

ResourceUid.CreateId();

Exception:

E 0:00:00:0608   object System.Runtime.CompilerServices.CastHelpers.ChkCast_Helper(System.Void*, object): System.InvalidCastException: Unable to cast object of type 'Godot.GodotObject' to type 'Godot.ResourceUidInstance'.
  <C++ 错误>       System.InvalidCastException
  <C++ 源文件>      :0 @ object System.Runtime.CompilerServices.CastHelpers.ChkCast_Helper(System.Void*, object)
  <栈追踪>          :0 @ object System.Runtime.CompilerServices.CastHelpers.ChkCast_Helper(System.Void*, object)
                 ResourceUid.cs:27 @ Godot.ResourceUidInstance Godot.ResourceUid.get_Singleton()
                 ResourceUid.cs:60 @ long Godot.ResourceUid.CreateId()
                 Main.cs:10 @ void Main._Ready()
                 Node.cs:2121 @ bool Godot.Node.InvokeGodotClassMethod(Godot.NativeInterop.godot_string_name&, Godot.NativeInterop.NativeVariantPtrArgs, Godot.NativeInterop.godot_variant&)
                 CanvasItem.cs:1368 @ bool Godot.CanvasItem.InvokeGodotClassMethod(Godot.NativeInterop.godot_string_name&, Godot.NativeInterop.NativeVariantPtrArgs, Godot.NativeInterop.godot_variant&)
                 Control.cs:2824 @ bool Godot.Control.InvokeGodotClassMethod(Godot.NativeInterop.godot_string_name&, Godot.NativeInterop.NativeVariantPtrArgs, Godot.NativeInterop.godot_variant&)
                 Main_ScriptMethods.generated.cs:48 @ bool Main.InvokeGodotClassMethod(Godot.NativeInterop.godot_string_name&, Godot.NativeInterop.NativeVariantPtrArgs, Godot.NativeInterop.godot_variant&)
                 CSharpInstanceBridge.cs:24 @ Godot.NativeInterop.godot_bool Godot.Bridge.CSharpInstanceBridge.Call(nint, Godot.NativeInterop.godot_string_name*, Godot.NativeInterop.godot_variant**, int, Godot.NativeInterop.godot_variant_call_error*, Godot.NativeInterop.godot_variant*)

Steps to reproduce

N/A

Minimal reproduction project

N/A

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions