Skip to content

Instantly share code, notes, and snippets.

@mao-test-h
Created September 3, 2018 16:47
Show Gist options
  • Save mao-test-h/b0a12d51604927dbbc84f59d84f2b99c to your computer and use it in GitHub Desktop.
Save mao-test-h/b0a12d51604927dbbc84f59d84f2b99c to your computer and use it in GitHub Desktop.
自動でGraphics Emulationを設定してくれるやつのサンプル。(これはWebGL2.0に自動で設定してくれる)
#if UNITY_EDITOR && UNITY_WEBGL
namespace MyContents.Editor
{
using UnityEngine;
using UnityEditor;
[InitializeOnLoad]
public class EditInitialSetting
{
static EditInitialSetting()
{
EditorApplication.update += Update;
}
static void Update()
{
bool isSuccess = EditorApplication.ExecuteMenuItem("Edit/Graphics Emulation/WebGL 2.0");
if (isSuccess)
{
EditorApplication.update -= Update;
}
}
}
}
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment