-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
[3.x] Add C# code examples (salvage of VinnNo's PRs) #5250
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
Conversation
Thanks so much for working on salvaging these, it'd be a shame for them to be left unused :) For reference to those PRs: https://github.com/godotengine/godot-docs/pulls?q=is%3Apr+is%3Aclosed+author%3AVinnNo+label%3Asalvageable |
|
||
public string GetFruit() | ||
{ | ||
var randomFruit = _fruits[GD.Randi() % _fruits.Length]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm probably alone on my hill but I'd use a do { ... } while (...);
to avoid duplicating this line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consistency with GDScript is more important here.
94ec468
to
9645613
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon
9645613
to
fda8af5
Compare
Thank you, and thanks to the reviewers! :) |
Hey! I didn't even know these were getting attention. So, I'm still VERY interested in proceeding with expanding the C# documentation, but honestly, I'm not sure how to structure these. I find that the nested code tabs conflict with the document bodies often, where variable names are mentioned (EG some_string vs SomeString) as GD and C# have two different style-guides. Also what should the approach for pages like this be? Anyway, thanks for salvaging these and improving them! |
I almost want to suggest a doc arrangement like this for the two languages, but I understand that is a big undertaking but it does read very well. |
Cherry-picked to the
The best way to handle this would be #4406. However, it still needs work before it can be merged. I don't know exactly how we could make that PR production-ready, so I don't have an ETA for it. |
This PR is mostly salvages of @VinnNo's PRs that add C# code examples, with lots of changes. It also updates the GDScript docs in a few places, targeting Godot 3.x.
master version: #5249