Setting z axis to certain point in scene and game view instantly...

I'm making a 2D game and I have a question:

Can you set up a script that makes all gameObjects in the scene view to have the z axis pre-set or only scripts that will change the z position in the game view?

If you can set one that works for scene view and game view can you post a script or tell how? Thanks.

You can use

@script ExecuteInEditMode()

at the top of your script to have it run while you are in Edit Mode. (watch out - no semicolon at the end of the line)

(for C#, its `[ExecuteInEditMode()]`).