-
Notifications
You must be signed in to change notification settings - Fork 40
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
Unity SDK: codegen to generate "enums" from .ts to .cs #144
Conversation
Codegen enum csharp
Hi @lpsandaruwan, thanks for the PR! I've just tried your branch and giving you some feedback below: I did compiled the repo (
I noticed the generated public struct ShipType {
public const string Transport = undefined;
public const string Miner = undefined;
public const string Colonizer = undefined;
} The expected output for public struct ShipType {
public const int Transport = 0;
public const int Miner = 1;
public const int Colonizer = 2;
} The public struct MessageType {
public const string DeployMiner = "deploy-miner";
public const string ColonizePlanet = "colonize-planet";
} Lastly, I've tried adding another enum declaration on export enum ShipType {/* ... */}
export enum MessageType {/* ... */}
export enum FixedValueEnum {
One = 1,
Two = 2,
Three = 3,
} After running public struct MessageType {
public const string DeployMiner = "deploy-miner";
public const string ColonizePlanet = "colonize-planet";
public const string One = 1;
public const string Two = 2;
public const string Three = 3;
} On this case, it should've defined a public struct FixedValueEnum {
public const int One = 1;
public const int Two = 2;
public const int Three = 3;
} Please let me know if you have any question, happy to discuss them! Cheers |
Related to: https://lucidsight.atlassian.net/browse/CLYS-143
References: #139