Hello everyone!
Is there a way to limit the letter count in MonoDevelop?
Sometimes I run into some really long lines and I need to scroll in order to read them which is, of course, not very handy.
Many thanks in advance,
Shushustorm
Hello everyone!
Is there a way to limit the letter count in MonoDevelop?
Sometimes I run into some really long lines and I need to scroll in order to read them which is, of course, not very handy.
Many thanks in advance,
Shushustorm
if i understand your question correct, why don’t you cut the line where you can into a new one? like after a comma and so…
First of all, thank you very much for your answer, jister!
I tried that and I ran into problems then. It didn’t seem to work, but I guess I just don’t know the rules that come with this solution.
For example, when I have something like this:
if (((something_that_has_been_done) == true) ((some_other_stuff_has_been_done) == true) ((even_some_further_stuff_has_been_done) == true))) {
something_happens();
}
I don’t know where I should break the line.
If I remember correctly, I tried this which didn’t work:
if ((something_that_has_been_done) == true)
((some_other_stuff_has_been_done) == true)
((even_some_further_stuff_has_been_done) == true)) {
something_happens();
}
Also, most of the time when I use Instantiate, there will be a long line like this:
clone_some_object = Instantiate(some_object, some_object_loc.position, some_object_loc.rotation);
This can be huge when the names are long and I don’t really know how to break this into several lines.
Your multi-line version has introduced an inconsistent number of parenthesis.
Try this instead:
if ( (something_that_has_been_done) == true
(some_other_stuff_has_been_done) == true
(even_some_further_stuff_has_been_done) == true
) {
something_happens();
}
With regards for your other line:
clone_some_object = Instantiate(
some_object,
some_object_loc.position,
some_object_loc.rotation
);
If you are using C# then you can also used named arguments (though this might only work when compiling DLLs; I can’t remember if Unity’s C# compiler supports this syntax):
clone_some_object = Instantiate(
original: some_object,
position: some_object_loc.position,
rotation: some_object_loc.rotation
);
Thank you very much for your answer, numbercruncher!
I guess this will solve the whole problem!
In fact, breaking the lines like that is even a better solution than what I was looking for!
This will actually make the code way “cleaner” and easier to read.
Oh and so far, I don’t use C#. I am new to Unity and programming in general and I decided to start off using UnityScript.
But thanks anyway! Maybe someone else can make use of this or I can use this later when learning C#.