- Home /
Best strategies for not accidently editing whilst still running
It keeps happening to me and i'm sure it must happen to other people, but when i'm previewing something in the editor I keep forgetting to click the play button to stop playback. I then end up performing sometimes lengthy edits that get thrown away when i finally realise i'm still running.
It's exagerrated when using unity remote as you are distracted putting down your iphone.
I was just wondering if there were any sound strategies for trying to avoid this. I can think of a few
- The GUI changes colour or otherwise makes it obvious that you are still running
- You have the option to run the game in a read only state so no matter what you try to do with the objects nothing changes and it becomes obvious that you are still running the game. Perhaps alt-clicking the play button allows the current normal running of the game with full editing
Beyond that, which i may suggest to unity. Anyone found a secret to stopping this slightly frustrating thing from happening?
I wonder why this question doesn't show up in the Questions $$anonymous$$ost Voted list any more? Too old, being from 2009?
Answer by duck · Dec 18, 2009 at 09:56 AM
I used to do this all the time too, but I discovered a simple and, in my experience, fail-safe solution:
- In Unity's menu, go to:
- (Windows) Edit -> Preferences
- (Mac) Unity -> Preferences
- Click the "Colors" button
- Select "Playmode tint"
- Change the color from its default (light grey) to a darker more obvious color. (I have mine as RGB: 100,80,80)
Now my UI goes quite dark and red-tinted in colour when in play mode, and there's no mistaking it! I've never accidentally edited in playmode since doing this.
The script that Ashkan linked to can still be useful though, because sometimes you still might want to edit in play mode and save your changes.
Ah, they should certainly change the default color ;-) ... I think the RGB scale you're using is based on % (values 0-100); in a value-based scale (0-255) that would be something like 255, 204, 204. Or are you really having it that dark? ;-)
awesome.. just as i hoped there was already a solution.. UI change sounds perfect to me.
hmm, can't be helped. But just thought i'd add that this suggestion is NOT possible with unity iPhone. There is NO Playmode tint, under the colors part of the preferences... Oh how i wish for the two Unity's features to come back together again :)
@jimbobuk: Yes that true, the playmode tint feature was added with the Editor GUI rewrite for Unity 2.5. As Unity iPhone 1.x is based on the pre 2.5 Editor it still lacks this feature. This will all be fixed in the unified Unity 3.0 editor GUI :-)
Answer by Ashkan_gc · Dec 18, 2009 at 04:22 AM
Hey guys! There is an editor script here called copy inspector that can help you. It allows you to copy components values while running and paste them when you stopped the game.
This script is written by AngryAnt (Mr. Johansen). He is one of the Unity's staff now. Thank you Mr. Johansen.
copy/paste transform could have real uses anyways even when just editing, i've been doing quite a bit of repetitive setup and have considered looking into the editor scripts as a way to automate them a little more. Definitely added to my TODO list. Thanks.
Not a problem. I hope you find it useful. I took the liberty of making the link point directly at the article and fixed some formatting and typos (including misspelling of my surname ;) ).
sorry for misspelling of your sirname. :( my english is not as well as it should be but having the answer with misspelled words is better than having nothing at all. :) thank you for correcting my mistakes
Note that you can also copy/paste entire game objects (ctrl-c/ctrl-v), so you can copy a game object while running, then paste it after you stop. This creates a new copy of the object, you can then either delete the original or use the new as reference for manual copying of tweaked parameters ... beats writing tweaks down on a scrap of paper!
Answer by Stelimar · Dec 18, 2009 at 04:33 AM
If you enable the Maximize on Play button in the Game window, the Game Window will expand when you hit play and get small again when you stop. The downside to this is that you can't see the inspector/hierarchy windows without opening them manually.
that is smart and what i do anyway, and it sure works! and really, what purpose does having the inspector showing in play mode if it's just going to delete it?
Answer by Peter Alexander · Dec 18, 2009 at 02:23 AM
I haven't really found any good way around this. Having music playing in your game can help a little, but generally I just try to be careful. I agree that it is very annoying and I've suggested to Unity to have an alternate mode where changes are kept.
Yeah. That's what I've been doing. Add an Audio Source to a null object attached to the root and put some kind of ambient sound on it (I use a room tone from a movie I did a while back). The sound lets you know the thing's running.
Another thought. Create a spinning red cube that just sits in the center of whatever you're doing.
Agreed that the UI change would be an excellent update.
:s.
Sorry, having to have music playing, or building your own animated on-screen indicator - while very inventive - are awful solutions! There's a much better way, see my answer.
I agree that your method is better, but there's no need for the insults, Duck.
Sorry Peter. $$anonymous$$y comment wasn't intended as a personal insult at all. I was commenting only on the solutions proposed (and in fact I complimented you & spencer on your inventiveness). I've countless times had valuable advice in the form of "that's an inventive but terrible way of doing it - use this ins$$anonymous$$d"! $$anonymous$$aybe it's just something you just get used to as a coder.
After debugging a game with in-game testing and hearing the same music 382729629 times you risk going Loopy. I sure as hell did
Answer by Shadyfella13 · Dec 19, 2009 at 04:34 AM
Maybe if there were some sort of translucent pop up (just a red highlighted text field and an"!" perhaps)that comes up when you make any kind of an edit whilst in Play mode.
I really liked Duck's strategy of changing the play screen tint ... good one.
Your answer
Follow this Question
Related Questions
Any idea how to use PreviewRenderUtility ? 3 Answers
Get default preview for GameObject Editor 2 Answers
How to get Project view's preview icon size? 0 Answers
Texture2D on Property Drawers. 0 Answers