Hi guys I’ve recently been making a script that two other scripts access at the same time. The reason I am doing this is the two things will behave differently enough that I don’t think I can combine them all into one script. Although because of the trouble I am having this may very well be the case.
My current set up is that the two scripts both modify lists of GameObjects my problem is at any one point one of the scripts could be calling Add() on a particular List however the other script (given the logic) will likely be calling Clear() on that very same list.
Given that these calls could run either concurrently or prioritize one script over another is there any way to allow one script to execute before another?
As I said I might have to bundle these two scripts together with logic to avoid that happening but I’m not sure how to go about that just yet either.
But I can't do it at run time based on certain conditions? That's useful information either way I'll muck around see what I can do with it.
– gRntausYou could do it at runtime, but you'd have to do something like your final suggestion and have a manager object decide which would run first.
– iwaldropThanks, I'm thinking if I need to start doing this I've tried to abstract my classes a little far and make them too segmented, I'm going to try merging them back together for now and see how we go if not I'll explore the above option.
– gRntaus