dwelling act 4 (live motion cap w/ kinect azure)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

35 lines
1.1 KiB

using UnityEditor;
namespace FullscreenEditor {
[InitializeOnLoad]
public class GameViewVSync {
static GameViewVSync() {
FullscreenCallbacks.afterFullscreenOpen += (fs) => {
RefreshViewVSync(fs.ActualViewPyramid.Window);
};
FullscreenCallbacks.afterFullscreenClose += (fs) => {
RefreshViewVSync(fs.m_src.Window);
};
}
private static void RefreshViewVSync(EditorWindow window) {
if (window && window.HasProperty("vSyncEnabled")) {
var vsyncEnabled = window.GetPropertyValue<bool>("vSyncEnabled");
// reset vsync
window.SetPropertyValue("vSyncEnabled", vsyncEnabled);
var view = new ViewPyramid(window).View;
// fallback when above doesn't work
if (view.HasMethod("EnableVSync"))
view.InvokeMethod("EnableVSync", vsyncEnabled);
else
Logger.Debug(string.Format("View {0} does not support vsync", view.GetType()));
}
}
}
}