While this does work, guessing you have found that it is not the most optimal, or reusable method. If you are already using separate scripts to reference your specific states I would recommend using a state machine process. If you do not want to reorganize your states then signals would most likely be a better substitute.