Skip to content

Instantly share code, notes, and snippets.

@neon-izm
Created August 13, 2018 08:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save neon-izm/32ef0441b5b0b1a4413aa54e6807c5c2 to your computer and use it in GitHub Desktop.
Save neon-izm/32ef0441b5b0b1a4413aa54e6807c5c2 to your computer and use it in GitHub Desktop.
//UnityEditorのゲームビューでカーソルを非表示にしておくスクリプト
//録画したときにカーソルが映り込むのを防止
public class GameViewHiddenCursor : MonoBehaviour
{
private void OnEnable()
{
Cursor.visible = false;
}
private void OnApplicationFocus(bool hasFocus)
{
if (hasFocus)
{
Cursor.visible = false;
}
else
{
Cursor.visible = true;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment