-
Notifications
You must be signed in to change notification settings - Fork 0
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
Doors and buttons #12
base: main
Are you sure you want to change the base?
Conversation
private void Awake() | ||
{ | ||
doorControllers = new List<DoorController>(); | ||
_button = transform.GetChild(1).gameObject; |
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.
why not a sf reference? this is fine though tbh
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.
since it was going to be used by others. I thought it would be easier that way.
|
||
private void Start() | ||
{ | ||
_counterTile = transform.GetChild(1).GetChild(0).gameObject; |
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.
kinda hacky, could be an sf especially if it requires two layers of getchild?
_buttons = new List<ButtonBehaviour>(buttonDictionary.Keys); | ||
_values = new List<int>(buttonDictionary.Values); | ||
|
||
foreach (var button in _buttons) |
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.
dictionaries are directly iterable, you dont need to split it and convert it into a list
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 tried
i think serializable dictionaries work diferent
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.
aite
if (tempOpen) return; | ||
_buttonActivated = true; | ||
for (int i = 0; i < _buttons.Count; i++) | ||
if (_buttons[i] == button) |
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.
you can just do _index = buttonDictionary[button]; instead of the entire for() loop and eliminate the entire ConvertToDictionary() function
No description provided.