public void OnEnable()
{
this.titleContent = new GUIContent("Exporter");
if (ExporterWindow.exportationOptions == null)
{
ExporterWindow.exportationOptions = CreateSettings();
}
// Attach unity editor buttons
UnityEditor.EditorApplication.playmodeStateChanged = () =>
{
if (exportationOptions != null && exportationOptions.AttachUnityEditor)
{
bool wantsToPlay = UnityEditor.EditorApplication.isPlayingOrWillChangePlaymode;
bool wantsToPause = UnityEditor.EditorApplication.isPaused;
if (wantsToPlay || wantsToPause)
{
UnityEditor.EditorApplication.isPlaying = false;
UnityEditor.EditorApplication.isPaused = false;
}
if (wantsToPlay) Execute();
}
};
// Activate asset store window
if (this.assetStore == null)
{
this.assetStore = Tools.GetAssetStoreWindow();
}
// Activate internl web server
this.StartServer();
}