We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
定义一个枚举类型在本地代码里 enum TestEnum { One, Two }
在热更代码里定义 var testEnum = TestEnum.Two;
Debug.Log($"{testEnum} : {testEnum.ToString()}") 输出的是"Two : 1"
在本地代码中得到的结果是"Two : Two"
在此种用法中热更代码里和本地代码里的结果行为不一致
测试用例: ` using System; using LitJson;
namespace TestCases { public class EnumTest { public enum TestEnum : long { Enum1, Enum2, Enum4 = 0x123456789, }
public static void Test11() { //热更内定义的枚举 var testEnum = TestEnum.Enum4; var valueDirectly = $"{testEnum}"; var valueToString = testEnum.ToString(); Console.WriteLine($"隐式字符值: {valueDirectly}"); Console.WriteLine($"显式字符值: {valueToString}"); if (valueDirectly.Equals(valueToString) == false) { throw new Exception($"字符值不一致: {valueDirectly} vs. {valueToString}"); } //本地定义的枚举 var jsonType = JsonType.Int; valueDirectly = $"{jsonType}"; valueToString = jsonType.ToString(); Console.WriteLine($"隐式字符值: {valueDirectly}"); Console.WriteLine($"显式字符值: {valueToString}"); if (valueDirectly.Equals(valueToString) == false) { throw new Exception($"字符值不一致: {valueDirectly} vs. {valueToString}"); } } }
}
`
The text was updated successfully, but these errors were encountered:
No branches or pull requests
定义一个枚举类型在本地代码里
enum TestEnum
{
One,
Two
}
在热更代码里定义
var testEnum = TestEnum.Two;
Debug.Log($"{testEnum} : {testEnum.ToString()}")
输出的是"Two : 1"
在本地代码中得到的结果是"Two : Two"
在此种用法中热更代码里和本地代码里的结果行为不一致
测试用例:
`
using System;
using LitJson;
namespace TestCases
{
public class EnumTest
{
public enum TestEnum : long
{
Enum1,
Enum2,
Enum4 = 0x123456789,
}
}
`
The text was updated successfully, but these errors were encountered: