Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

如何将枚举值转换为其基础类型? #1143

Closed
svermeulen opened this issue May 11, 2024 · 1 comment
Closed

如何将枚举值转换为其基础类型? #1143

svermeulen opened this issue May 11, 2024 · 1 comment

Comments

@svermeulen
Copy link

我从文档中看到枚举类型有一个 __CastFrom 方法,但是反方向呢?我有一个枚举值,想要它的原始值(在这个例子中是 int)。我无法弄清楚如何在 Lua 中获得它。我看到它是一个用户数据值,但没有看到任何获取原始值的方法。

@Philofallever
Copy link

CS.System.Convert.ToInt32(enumValue)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants