#At this point I m not sure what answer

1 messages · Page 1 of 1 (latest)

trim stirrup
#

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.

jagged kite
#

But what's exactly the problem? What is not working? Changing the panel?

trim stirrup
#

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.

jagged kite
#

When you click on the top modules buttons?

trim stirrup
#

yes.

#

I think.

jagged kite
#

Does the console say something?

trim stirrup
#

mm... I have it full of debugwarnings/logs. so its pretty crammed.

#

and uh...

#

the perfect version of the code shows no errors.

jagged kite
#

The perfect version?

trim stirrup
#

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.^

jagged kite
#

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

trim stirrup
#

it turns to 5. but all of those are my own add ons...

#

they didnt originate.

trim stirrup
jagged kite
#

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

trim stirrup
#

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.

jagged kite
#

Why would be that? You can create a method that disables every panel but the one that you want

trim stirrup
#

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.

jagged kite
#

Do you want me to create a call so I can show you?

trim stirrup
#

hum... I cant really talk. but I can watch.

jagged kite
#

Yeah it's ok

trim stirrup
#

what would you think of the problem at hand?

jagged kite
#

I didn't see the setup. Do you have the script that you copied in the general in each button?

trim stirrup
#

yes xd

#

^and the 2 last scripts, 3 of them are not in this branch

#

the 2 last scripts use instantiated at runtime information...

jagged kite
#

Last two? I only see one

trim stirrup
#

ah crpa

jagged kite
#

If you can copy them I can take a look

trim stirrup
#

yeah in a bit.

#
#

last two*

#

xDD its.. a lot of code :D

#

as spaghetti as it gets~

jagged kite
#

Last two are identical

trim stirrup
#

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.

jagged kite
#

But which ones are you using?

trim stirrup
#

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)

trim stirrup
#

there are 3 sets of panels. :D

#

each with button matching a panel. xd and different numbers of panels. :D

jagged kite
#

With the method that I copied to you it should work for every group of buttons/panels

#

Just dragging the references

trim stirrup
#

cant drag references when they are instantiated.

jagged kite
#

You just need one script for the same logic

trim stirrup
#

then you gotta go trough enum lists to do that

#

and for that I need to access and create scriptable object libraries

jagged kite
#

No hahah

trim stirrup
#

enum Library lists*

jagged kite
#

You can pass the reference

#

GameObject instance = Instantiate(whatever)

#

Pass the instance to the array, and to the correct button

trim stirrup
#

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

jagged kite
#

There are a lot of options to do this yeah

trim stirrup
#

possibly a privacy issue...

jagged kite
#

You need a public variable thats for sure

trim stirrup
#

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...

jagged kite
#

Hahahaha, just until you get the grap to how it works

trim stirrup
#

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.

jagged kite
#

Use the debug option of visual studio. It helps a lot

trim stirrup
#

^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

jagged kite
#

Hahahha have fun with that, it's better that having 1000 debug

trim stirrup
#

XD yes.

#

thanks for the help !