unity script to change object in edit mode code example
Example: unity how to make code only run in editor
#if UNITY_EDITOR //Code here for Editor only. #endif
#if UNITY_EDITOR //Code here for Editor only. #endif