public static void Init(System.Action <BuildVersionData> action) { m_callback = action; BuildVersionWindow window = (BuildVersionWindow)EditorWindow.GetWindow(typeof(BuildVersionWindow), false, "Build Version Window", true); int width = 450; int height = 250; window.maxSize = new Vector2(width, height); window.minSize = new Vector2(width, height); m_displayIndex = PlayerPrefs.GetInt("BuildWindowDisplayIndex", 0); Debug.Log("displays: " + Display.displays.Length); if (m_displayIndex >= Display.displays.Length) { m_displayIndex = 0; } float x = 0; float y = 0; for (int i = 0; i < Display.displays.Length; i++) { if (i < m_displayIndex) { x += Display.displays[i].renderingWidth; } else if (i == m_displayIndex) { y = (Display.displays[i].renderingHeight / 2) - (height / 2); x += (Display.displays[i].renderingWidth / 2) - (width / 2); } } Debug.Log(string.Format("x:{0} -> y:{1} -> displayIndex:{2}", x, y, m_displayIndex)); window.position = new Rect(x, y, width, height); window.autoRepaintOnSceneChange = true; window.Show(); }
public static void BuildVersionModify() { BuildVersionWindow.Init((buildData) => { ModifyBuildVersion(buildData); string gradlePath = Path.Combine(Application.dataPath, "../JenkinsScripts/AndroidGradleStuff/launcher/build.gradle"); BuildUtility.HandleGradleVersion(gradlePath, buildData); }); }