Question regarding script size

I just have a (rather noobish) performance question since my dialogue script is getting bigger and bigger and I’d like to understand how unity does it’s stuff.

Do the number of lines somehow affect performance if they’re not constantly called? Like, if you have a lot of functions that only get called once or maybe twice in a game - does that affect performance or doesn’t it matter at all?

So far, I have a function for each of my NPC types containing all the dialogue possibilities and 2500 lines of code in total. I’m just wondering if it’s okay to go way above that - if it’s not things that are called.

Can anyone shed some light on this? That would be much appreciated.

Code that’s not being run doesn’t affect performance. However, from a script maintenance point of view, it sounds like you would be far better off with some kind of database system, instead of hard-coding everything.

–Eric

Thanks! That’s good to know.

I’ve heard that tip with the database before and I’m sure it’s right. Unfortunately, I have no idea how to do it any other way then hardcoding with loads of “if” statements… My coding is not very advanced I’m afraid.