Hello,
what am I missing here? plz help me
object forgets awake() set values on play
copying the code from awake() to start() seems silly?
do I call awake() in start? → just tried that didn’t work either…
Hello,
what am I missing here? plz help me
object forgets awake() set values on play
copying the code from awake() to start() seems silly?
do I call awake() in start? → just tried that didn’t work either…
?..
post the code?
Awesome asset! have you got anything planned for painting sprites?
the codes quite a mess, i’m new to programming so i work through mostly by trial and error , which i know is silly but i’m to impatient for tutorials
its a List<List> thats throwing me a out of range when i edit a color after i hit play, and persists after i go back to editor mode
after i remove and add the component back all is good until i hit play again
when i’m in the editor i choose a color and it updates multiple pieces fine without the out of range
Already support it :). You can paint colors or images onto a texture.
might be something do to with it being a List<List>?
[ExecuteInEditMode]
[Serializable] public class colorManager
[SerializeField] public List<List<int>> colorLayers;
void Awake()
if( colorLayers == null)
{
Debug.Log("List null again.......");
colorLayers = new List<List<int>>();
}
… confirmed for some reason List<List> nulls out after play mode… i have no idea why this happens
if that is all your code you are missing a step…
this doesn’t create a list, it merely declares it “i am going to have something called colorLayers and it’s public accessible and it’s a listlistint…” being something other than a primitive its default is “null”.
You have to initialise the list by doing
i.e. what you’ve done, you just don’t need to check if it’s null since it is always going to be null at that stage.
And why are you trying to serialize it? Don’t count on that type being serializable in a million years.
Thank you for you help, yes the null happens on first wake setup → and when i hit play mode which is after its been initialized → it null again.
I managed to work around this by ditching the list<list> and using a list (which has a list in it )
so its something to do with serializing,
using a custom editor so…
i don’t understand why someone trying to customize the GUI should have to know what serializing is…
any recommendations on visual scripting extensions? , can one edit the gui with them?
btw can you animate the painting process with your extension?, cause that would be awesome
I’m getting the feeling you’re trying to do something in an “un-unity” way which is making things more tricky than you’re expecting. Perhaps you could explain what you are trying to achieve with this approach, there might be a way of doing it in another way which is more straightforward?
I think it’s the fact that you are only creating an empty list that should contain lists of int.
You need to loop through populating the List.
But if you are populating the List via the editor and relying on Unity to remember and populate the List<List> then you should not be resetting the List on Awake().
I totally agree, i think my color manager is going to make my brain explode the way it is now… but it is working finally :(…
it just keeps track of objects in layers and then applies the same colors to the same layers, the objects are made up of parts and pieces so that got me a bit confused when building a collection to keep track of em
it only sets it up if its null, yea i learnt this after my first couple out of range errors, List<List> = new List<List>(); List[×] = new List();
smilies are fun