Created
September 3, 2018 16:47
-
-
Save mao-test-h/b0a12d51604927dbbc84f59d84f2b99c to your computer and use it in GitHub Desktop.
自動でGraphics Emulationを設定してくれるやつのサンプル。(これはWebGL2.0に自動で設定してくれる)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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