Hello!, I'm doing some experimental code and personal self-taught study.
This block I'll show you it's part of a 'game' for Unity.
So, I have a more a request than a question: I would like some criticism on this code. Anything that you can think about the usefulness, pro-tips, curiosity tips, alternatives, syntax... anything would be great.
The reason is that I have always so many questions on so many perspectives, that i can never adress them all on a single question and I end up solving it by myself, which kind of feels like re-inventing the wheel. Also I have not much time to be waiting and checking for answers (and i solve it in "less time" but more effort and therefore, less time actually experimenting and learning more). So doing this i feel like it could improve many other things based on what I already know and saving a lot of time on explaining my actual understanding to be explained what i need to understand...
I hope i made myself clear with that explanation because I would like to clarify a couple things:
1- Anything you tell me, will do. Maybe more, maybe less yeah. But for the reason mentioned above, I won't answer this post too much. However:
2- I will gladly answer any questions you may want to ask me, as soon as i read them, but I will only answer to help you answer me. Therefore, if your question is, for example, about why do I do anything or so, I wont answer., because that doesn't help you from answering me, just excuses you from not answering and I need code critics, not life choice critics or ways of learning, etc. Thanks in advance for the understanding about this.
3- Sorry for the bad english. Not my native language.
This block I'll show you it's part of a 'game' for Unity.
So, I have a more a request than a question: I would like some criticism on this code. Anything that you can think about the usefulness, pro-tips, curiosity tips, alternatives, syntax... anything would be great.
The reason is that I have always so many questions on so many perspectives, that i can never adress them all on a single question and I end up solving it by myself, which kind of feels like re-inventing the wheel. Also I have not much time to be waiting and checking for answers (and i solve it in "less time" but more effort and therefore, less time actually experimenting and learning more). So doing this i feel like it could improve many other things based on what I already know and saving a lot of time on explaining my actual understanding to be explained what i need to understand...
I hope i made myself clear with that explanation because I would like to clarify a couple things:
1- Anything you tell me, will do. Maybe more, maybe less yeah. But for the reason mentioned above, I won't answer this post too much. However:
2- I will gladly answer any questions you may want to ask me, as soon as i read them, but I will only answer to help you answer me. Therefore, if your question is, for example, about why do I do anything or so, I wont answer., because that doesn't help you from answering me, just excuses you from not answering and I need code critics, not life choice critics or ways of learning, etc. Thanks in advance for the understanding about this.
3- Sorry for the bad english. Not my native language.
C#:
public MouseButton DragButton
{
get
{
if (dragButton == MouseButton.None)
{
dragButton = MouseButton.Left;
}
return dragButton;
}
set
{
try
{
if (value == MouseButton.None)
{
string msg = string.Format("DragButton Can't be None. It will be set to its default value: ({0}).", dragButton);
throw new UnauthorizedAccessException(msg);
}
}
catch (UnauthorizedAccessException) { value = dragButton; }
finally { dragButton = value; }
}
}
Last edited: