I want to ask if script editing during runtime is officially supported ?
I noticed that for simple scenes/scripts, it works. However, if I use something like a singleton pattern, the classes inside those singleton objects become null whenever I edit my script in runtime.
Build a simple state machine. You can for example do this by having a base class for your AI states, and in this state class u define some virtual methods and then override them in inherited states. By doing this you can call different methods from the same identifier. Then add your states to some container (ex System.Collections.Generic.List) and execute them.
This is just a method for abstraction and It’s up to you how much of the AI behaviour you want to abstract out from the AI class.
I know about state machines, but it’s just an AI algorithm.
My question is about how I can make Unity to allow me to edit the scripts during play and see my changes in real time.
For example, if I change my state machine in a script, I want it to be reflected directly in the game.