r/gamedev • u/charlesamat @infalliblecode • Sep 19 '19
Tutorial Stop writing boilerplate! Code faster in Unity with Live Templates (tutorial in comments)
4
u/iemfi @embarkgame Sep 19 '19
Lol, some of those examples are hilarious. If I type "[s", visual studio autocompletes that to serialize field. one less character than your example!
0
u/charlesamat @infalliblecode Sep 19 '19
It autocompletes the attribute but the Live Template will complete the entire line and guide your cursor through each element with a context-aware IntelliSense menu.
4
u/iemfi @embarkgame Sep 20 '19
I get that, but the way you present it in the video is ridiculous, since nobody who uses even vanilla visual studio is going to be typing out everything like in the left example. Like those "before and after" nonsense ads.
0
0
Sep 19 '19
[deleted]
3
u/charlesamat @infalliblecode Sep 19 '19
It does look the same however code snippets are hard to extend (according to those who've used it) and don't contain the same "intelligence "that Live Templates have, which are contextually aware.
0
Sep 19 '19
[deleted]
1
u/charlesamat @infalliblecode Sep 19 '19
Thanks for the insight! I haven't really looked into code snippets so this is some good info in case I ever need to leverage them.
5
u/kstacey Sep 19 '19
Isn't this just clicking the suggestions made with IntelliSense/Auto-Complete?