This editor script takes screenshots for you when you press command-control-s. The screenshots are numbered dependant on the existing files and are placed in the root level of your project. As of Unity 1.2.2, there are bugs or lack of features that allow a more sensible keyboard shortcut (say, command-shift-5) and allow the menu item to be placed in a location like the Window or File menu.

+

This editor script takes screenshots for you when you press command-control-s. The screenshots are numbered dependant on the existing files and are placed in the root level of your project. As of Unity 1.2.2, there are bugs or lack of features that allow the menu item to be placed in a location like the Window or File menu.

==Usage==

==Usage==

Line 12:

Line 12:

==C# - TakeScreenshotInEditor.cs==

==C# - TakeScreenshotInEditor.cs==

−

<csharp>

+

<syntaxhighlight lang="csharp">

using UnityEngine;

using UnityEngine;

using UnityEditor;

using UnityEditor;

Line 26:

Line 26:

int number = startNumber;

int number = startNumber;

string name = "" + number;

string name = "" + number;

−

while (name.Length < 3)

−

name = 0 + name;

while (System.IO.File.Exists(fileName + name + ".png"))

while (System.IO.File.Exists(fileName + name + ".png"))

Line 33:

Line 31:

number++;

number++;

name = "" + number;

name = "" + number;

−

while (name.Length < 3)

−

name = 0 + name;

}

}

Line 42:

Line 38:

}

}

}

}

−

</csharp>

+

</syntaxhighlight>

Latest revision as of 20:47, 10 January 2012

This editor script takes screenshots for you when you press command-control-s. The screenshots are numbered dependant on the existing files and are placed in the root level of your project. As of Unity 1.2.2, there are bugs or lack of features that allow the menu item to be placed in a location like the Window or File menu.