New answers tagged unity3d
4
votes
Can I lessen the use of boolean flag variables in this snippet?
You currently have two booleans, capable of representing 4 states (like many other answers have shown with helpful truth tables). But there's actually only 3 cases here: show, hide, and do nothing. If ...
6
votes
Can I lessen the use of boolean flag variables in this snippet?
Since this is tagged unity3d, rather than setting a flag somewhere else in the script, you can just do the following:
...
2
votes
3
votes
Can I lessen the use of boolean flag variables in this snippet?
I think a higher level review of how this whole button thing works.
I want to express a slightly different approach and instead of bShow and ...
0
votes
Optimize and Simplify Raycasting Code in Unity for Store Clerk Interaction?
You could simplify the code by reducing redundant checks and combining conditions.
...
7
votes
Can I lessen the use of boolean flag variables in this snippet?
Why don't you make button.show() simply do an early exit if the visibility state being passed in is already the same? I'm surprised it doesn't already work this ...
0
votes
Optimize and Simplify Raycasting Code in Unity for Store Clerk Interaction?
SCText.SetActive(true);
LookingStoreClerk = true;
...
SCText.SetActive(false);
You never set ...
10
votes
Can I lessen the use of boolean flag variables in this snippet?
Each call to handleInputEvents() can set bShow to a new boolean value.
We could approach the display update task by making a
truth table.
...
17
votes
Can I lessen the use of boolean flag variables in this snippet?
Can I lessen the use of boolean flag variables in this snippet?
Consider 1st comparing.
...
10
votes
Can I lessen the use of boolean flag variables in this snippet?
I'm not familiar with unity so, I can't review your code from that perspective. But we can certainly make this code more concise. Let me show you how to get started with refactor this code.
1. Get rid ...
Top 50 recent answers are included
Related Tags
unity3d × 230c# × 222
game × 34
performance × 32
beginner × 14
design-patterns × 10
networking × 8
algorithm × 7
object-oriented × 7
.net × 6
comparative-review × 5
pathfinding × 5
physics × 5
event-handling × 4
serialization × 4
graphics × 4
ai × 4
strings × 3
multithreading × 3
json × 3
random × 3
database × 3
animation × 3
collections × 3
c++ × 2