#At this point I m not sure what answer
1 messages · Page 1 of 1 (latest)
having fun is essential to coding.*
this is the image of the ultimatum. the non working script.
you go trough panels (left, behind) and panels (top layer panel). (4 panels), which have topics 1-5, which change the panel that's empty now.
^see, its not empty on launch. its not empty toggling between panels 1-4. its not empty toggling between panels 1-2. its not empty when toggling between panels 1-2. then 1-4, then 1-2. then topics 1-5.
until.
ONE of them is.
^its an error that might not ever show up at this point.
error as in, user's gonna be annoyed if that ever happens. and its easily fixed toggling the panels some more.
But what's exactly the problem? What is not working? Changing the panel?
toggling between panels, in succession, ends in a point in which one time the panel does not open.
the final panels, that is. the ones under topics.
When you click on the top modules buttons?
Does the console say something?
mm... I have it full of debugwarnings/logs. so its pretty crammed.
and uh...
the perfect version of the code shows no errors.
The perfect version?
mm. its been a long day. Ive tried a lot of things. and at times, theres no errors, sometimes theres 1. and then I backtrack ect.
rn theres one, its not related to the actual script.
and uh, after I close the game.^
You could start removing useless code, well, not useless, but you could add the method that you want to call from the inspector, allowing you to remove the onEnable, onDisable methods
isnt onEnable/disable pretty essential for toggles?
Probably you have a callback or something called when a GameObject is destroyed, when you exit play is being called but there are no gameobjects to call it
No it's not, you can do it from the inspector
You only need the method that you want to call
This is in my project, you can call any method from here
It's the same for a button
ah yes, hmm. is it the same for buttons?
theres the option for button onclick, and add the method there, but thats not how the code works like rn.
changing it into that... proved to a bit of a hazzle as well.
Why would be that? You can create a method that disables every panel but the one that you want
if I were to do that, itd take me hours. and I dont think it fixes anything.
how would you activate that method?
seeing as you run panels+buttons, onclick sounds reasonable to me.
Do you want me to create a call so I can show you?
hum... I cant really talk. but I can watch.
Yeah it's ok
in the case that I dont start from removing the useless code & transition to onClicks.
what would you think of the problem at hand?
I didn't see the setup. Do you have the script that you copied in the general in each button?
yes xd
^and the 2 last scripts, 3 of them are not in this branch
the 2 last scripts use instantiated at runtime information...
Last two? I only see one
ah crpa
If you can copy them I can take a look
yeah in a bit.
https://hastepaste.com/view/aUxHHc
https://hastepaste.com/view/lcxIV
https://hastepaste.com/view/ktUBN0p
First three.
https://hastepaste.com/view/hMeffiuAn
https://hastepaste.com/view/cl4gvw5
last two*
xDD its.. a lot of code :D
as spaghetti as it gets~
Last two are identical
huh.
fixing that*
they are basically the same script. 2x + 2x, tabbuttons, topic buttons. tabbuttons/panels work together with ToggleMyOwn first toggle of panels 1&2.
But which ones are you using?
if (_TabManager)
_TabManager.OpenTabButton = null;
BackgroundPanel.SetActive(false);
for (int i = 0; i < AnotherGameObjectArray2.Length; i++)
{
AnotherGameObjectArray2[i].SetActive(false);
}
^this essentially removed the issue betwee the two.
now the issue is between the third and the first 2... ( or 1-2 and 1-4)
all of them.
there are 3 sets of panels. :D
each with button matching a panel. xd and different numbers of panels. :D
With the method that I copied to you it should work for every group of buttons/panels
Just dragging the references
cant drag references when they are instantiated.
You just need one script for the same logic
then you gotta go trough enum lists to do that
and for that I need to access and create scriptable object libraries
No hahah
enum Library lists*
You can pass the reference
GameObject instance = Instantiate(whatever)
Pass the instance to the array, and to the correct button
hmm.
I wonder. if the difference between onClick and this is still the null check. Considering this doesnt need it to work, and works well without it.
onClick has other functions to it, Ithink, that are good to have though
There are a lot of options to do this yeah
imma try remember what the issue with that was.... Im pretty sure there was one.
possibly a privacy issue...
You need a public variable thats for sure
imma def think about this.
its gonna have to be tomorrow+ then. cause soon work over. :D
but like. last time I tried this, it took me...the whole day to setup. xD and it didnt work...
Hahahaha, just until you get the grap to how it works
making an onclick function on your own? 30 mins. altering some pro's 130 line script spread across 2 scripts, manager and behaviour that operates on nullchecks, to then match your instantiated variables/not use "this.button"? well. thats a toughie. XD
I have probably figured out some of that by now, so its not gonna take as long maybe.
Use the debug option of visual studio. It helps a lot
^oh yes.
thats gonna be prio 1 tbh.
just got send a link to a video on that.
or a series of videos. :D
have been running only debug.logs till now
Hahahha have fun with that, it's better that having 1000 debug