- Home /
Stop play procedure from within a script
Hi,
i have two questions: 1. is it possible to stop the "play" procedure which you can initiate within the unity GUI from a script attached to an gameobject? 2. where can i find a command line (windows 7) reference which i will need for generating a batch file?
basically i would like to generate a set of 6000 screenshots which will be used to create a video in virtualdub.
look forward for any help, dalininum
Answer by Bunny83 · Dec 05, 2011 at 11:42 PM
Why not just take the screenshots in Unity? Just write a little editor script.
Have you tried Application.CaptureScreenshot?
If you want more control over the procedure or to use it in a webbuild you can do it manually like in this example of WWWForm.
However if you really want to do it with a batch file here is the command line reference for the Unity editor (google -->"unity command line"--> first result).
To control the editor features (like play, pause,...) take a look at EditorApplication
Thanks a lot for the answer!
i have already a script to capture the screenshots, it works perfectly fine. i also have the folders in which the png files will be transferred to. from there, virtualdub will do the rest ... of course i also know about the command line reference you mention, but for my purposes i need also the commands for procedures like "open java scipt XY", "copy data from txt file", "paste it to the javascript xy" and "save the javascript XY", so i'm not satisfied with the small amount of options the command line reference you mentioned offers. is stuff like that more bound to some unity independent manipulations more depending on windows line commands themselves?
the EditorApplication part works just fine, thx!
ehmm, that's not what Unity is meant for. It's not your opperating system. You can do all this in a script in Unity, but not as commandline parameters.
If you have a batch file just use the os commands (most exists since DOS).
$$anonymous$$
COPY
...
Just open C$$anonymous$$D (press windows$$anonymous$$ey + R, type "C$$anonymous$$D" and press enter) and type "HELP". That should be enough information to get this done.
oh and btw: Don't post comments as answers. Answers should exclusively used for answering the question. Use "add new comment" below the post you want to comment on.
ps. I've converted your answer into a comment.
Your answer
Follow this Question
Related Questions
In game pause menu 2 Answers
Spawn object problem 1 Answer
Show Files/Folders in a Folder When typing in a text field 0 Answers
how to stop a script for a while? 3 Answers
Stopping a bit of script once it reaches certain number. 2 Answers