Then assigned to its value in the Inspector, this value can be assigned to the code
But if change the variables in the code, the values in the Inspector will permanently alter
Game starts next time, don't use the start value given by the
How to avoid in the code changes permanent public variables affect the Prefab?
CodePudding user response:
Already make a Prefab, and use it every time you generate, generate to the assignment, when not destroyed,CodePudding user response:
Isn't in the Start or Awake to variable assignment, it will be overwritten each time you Start the fall assignment in the inspectorCodePudding user response:
Prefab into the scenario is to use Instantiate to InstantiateIt only change the instantiated object script corresponding public variables can
Do not change the script for the prefab directly, only change it copy the object's script