Unity3D导出exe窗口参数调整培训

欢迎来到unity学习unity培训、unity企业培训教育专区,这里有很多U3D资源U3D培训视频U3D教程U3D常见问题U3D项目源码,我们致力于打造业内unity3d培训、学习第一品牌。

下面我们开始今天的Unity3D技能培训。 我们学习Unity3D培训目标:让U3D初学者可以更快速的掌握U3D技术,自行制作修改素材,可以独立完成2D、3D小规模游戏及网页游戏开发。

[csharp] view plaincopy

  1. using System;
  2. using System.Runtime.InteropServices;
  3. using UnityEngine;
  4. public class WindowMod : MonoBehaviour
  5. {
  6. public enum appStyle
  7. {
  8. FullScreen,
  9. WindowedFullScreen,
  10. Windowed,
  11. WindowedWithoutBorder
  12. }
  13. public enum zDepth
  14. {
  15. Normal,
  16. Top,
  17. TopMost
  18. }
  19. private const uint SWP_SHOWWINDOW = 64u;
  20. private const int GWL_STYLE = -16;
  21. private const int WS_BORDER = 1;
  22. private const int GWL_EXSTYLE = -20;
  23. private const int WS_CAPTION = 12582912;
  24. private const int WS_POPUP = 8388608;
  25. private const int SM_CXSCREEN = 0;
  26. private const int SM_CYSCREEN = 1;
  27. public WindowMod.appStyle AppWindowStyle = WindowMod.appStyle.WindowedFullScreen;
  28. public WindowMod.zDepth ScreenDepth;
  29. public int windowLeft = 10;
  30. public int windowTop = 10;
  31. public int windowWidth = 800;
  32. public int windowHeight = 600;
  33. private Rect screenPosition;
  34. private IntPtr HWND_TOP = new IntPtr(0);
  35. private IntPtr HWND_TOPMOST = new IntPtr(-1);
  36. private IntPtr HWND_NORMAL = new IntPtr(-2);
  37. private int Xscreen;
  38. private int Yscreen;
  39. private int i;
  40. [DllImport("user32.dll")]
  41. private static extern IntPtr GetForegroundWindow();
  42. [DllImport("user32.dll", CharSet = CharSet.Auto)]
  43. public static extern bool SetWindowPos(IntPtr hWnd, IntPtr hPos, int x, int y, int cx, int cy, uint nflags);
  44. [DllImport("User32.dll")]
  45. private static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
  46. [DllImport("User32.dll")]
  47. private static extern int SetWindowLong(IntPtr hWnd, int nIndex, int dwNewLong);
  48. [DllImport("User32.dll")]
  49. private static extern int GetWindowLong(IntPtr hWnd, int dwNewLong);
  50. [DllImport("User32.dll")]
  51. private static extern bool MoveWindow(IntPtr hWnd, int x, int y, int width, int height, bool repaint);
  52. [DllImport("user32.dll", CharSet = CharSet.Auto)]
  53. public static extern int ShowWindow(IntPtr hwnd, int nCmdShow);
  54. [DllImport("user32.dll", CharSet = CharSet.Auto)]
  55. public static extern int SendMessage(IntPtr hwnd, int msg, IntPtr wP, IntPtr IP);
  56. [DllImport("user32.dll", CharSet = CharSet.Auto)]
  57. public static extern IntPtr SetParent(IntPtr hChild, IntPtr hParent);
  58. [DllImport("user32.dll", CharSet = CharSet.Auto)]
  59. public static extern IntPtr GetParent(IntPtr hChild);
  60. [DllImport("User32.dll")]
  61. public static extern IntPtr GetSystemMetrics(int nIndex);
  62. private void Start()
  63. {
  64. this.Xscreen = (int)WindowMod.GetSystemMetrics(0);
  65. this.Yscreen = (int)WindowMod.GetSystemMetrics(1);
  66. if (this.AppWindowStyle == WindowMod.appStyle.FullScreen)
  67. {
  68. Screen.SetResolution(this.Xscreen, this.Yscreen, true);
  69. }
  70. if (this.AppWindowStyle == WindowMod.appStyle.WindowedFullScreen)
  71. {
  72. Screen.SetResolution(this.Xscreen - 1, this.Yscreen - 1, false);
  73. this.screenPosition = new Rect(0f, 0f, (float)(this.Xscreen - 1), (float)(this.Yscreen - 1));
  74. }
  75. if (this.AppWindowStyle == WindowMod.appStyle.Windowed)
  76. {
  77. Screen.SetResolution(this.windowWidth, this.windowWidth, false);
  78. }
  79. if (this.AppWindowStyle == WindowMod.appStyle.WindowedWithoutBorder)
  80. {
  81. Screen.SetResolution(this.windowWidth, this.windowWidth, false);
  82. this.screenPosition = new Rect((float)this.windowLeft, (float)this.windowTop, (float)this.windowWidth, (float)this.windowWidth);
  83. }
  84. }
  85. private void Update()
  86. {
  87. if (this.i < 5)
  88. {
  89. if (this.AppWindowStyle == WindowMod.appStyle.WindowedFullScreen)
  90. {
  91. WindowMod.SetWindowLong(WindowMod.GetForegroundWindow(), -16, 369164288);
  92. if (this.ScreenDepth == WindowMod.zDepth.Normal)
  93. {
  94. WindowMod.SetWindowPos(WindowMod.GetForegroundWindow(), this.HWND_NORMAL, (int)this.screenPosition.x, (int)this.screenPosition.y, (int)this.screenPosition.width, (int)this.screenPosition.height, 64u);
  95. }
  96. if (this.ScreenDepth == WindowMod.zDepth.Top)
  97. {
  98. WindowMod.SetWindowPos(WindowMod.GetForegroundWindow(), this.HWND_TOP, (int)this.screenPosition.x, (int)this.screenPosition.y, (int)this.screenPosition.width, (int)this.screenPosition.height, 64u);
  99. }
  100. if (this.ScreenDepth == WindowMod.zDepth.TopMost)
  101. {
  102. WindowMod.SetWindowPos(WindowMod.GetForegroundWindow(), this.HWND_TOPMOST, (int)this.screenPosition.x, (int)this.screenPosition.y, (int)this.screenPosition.width, (int)this.screenPosition.height, 64u);
  103. }
  104. WindowMod.ShowWindow(WindowMod.GetForegroundWindow(), 3);
  105. }
  106. if (this.AppWindowStyle == WindowMod.appStyle.Windowed)
  107. {
  108. if (this.ScreenDepth == WindowMod.zDepth.Normal)
  109. {
  110. WindowMod.SetWindowPos(WindowMod.GetForegroundWindow(), this.HWND_NORMAL, 0, 0, 0, 0, 3u);
  111. WindowMod.SetWindowPos(WindowMod.GetForegroundWindow(), this.HWND_NORMAL, 0, 0, 0, 0, 35u);
  112. }
  113. if (this.ScreenDepth == WindowMod.zDepth.Top)
  114. {
  115. WindowMod.SetWindowPos(WindowMod.GetForegroundWindow(), this.HWND_TOP, 0, 0, 0, 0, 3u);
  116. WindowMod.SetWindowPos(WindowMod.GetForegroundWindow(), this.HWND_TOP, 0, 0, 0, 0, 35u);
  117. }
  118. if (this.ScreenDepth == WindowMod.zDepth.TopMost)
  119. {
  120. WindowMod.SetWindowPos(WindowMod.GetForegroundWindow(), this.HWND_TOPMOST, 0, 0, 0, 0, 3u);
  121. WindowMod.SetWindowPos(WindowMod.GetForegroundWindow(), this.HWND_TOPMOST, 0, 0, 0, 0, 35u);
  122. }
  123. }
  124. if (this.AppWindowStyle == WindowMod.appStyle.WindowedWithoutBorder)
  125. {
  126. WindowMod.SetWindowLong(WindowMod.GetForegroundWindow(), -16, 369164288);
  127. if (this.ScreenDepth == WindowMod.zDepth.Normal)
  128. {
  129. WindowMod.SetWindowPos(WindowMod.GetForegroundWindow(), this.HWND_NORMAL, (int)this.screenPosition.x, (int)this.screenPosition.y, (int)this.screenPosition.width, (int)this.screenPosition.height, 64u);
  130. }
  131. if (this.ScreenDepth == WindowMod.zDepth.Top)
  132. {
  133. &

更多精彩请点击 http://www.gopedu.com/

时间: 2024-08-08 21:52:23

Unity3D导出exe窗口参数调整培训的相关文章

技巧-Linux内核参数调整办法

技巧 -Linux内核参数调整办法 ulimit设置 ulimit -n 要调整为100000甚至更大. 命令行下执行 ulimit -n 100000即可修改.如果不能修改,需要设置 /etc/security/limits.conf,加入 * soft nofile 262140 * hard nofile 262140 root soft nofile 262140 root hard nofile 262140 * soft core unlimited * hard core unli

7.1-Move_base 参数调整

Move_base Tuining 前言 应项目需求,我需要调整move_base参数,使得机器人可以精确旋转到指定角度,之前只能实现较为精确的到达(x,y)坐标,现在要求,又要精确又要不震荡地达到目标要求. 需要全面了解局部避障算法,才能正确地调整参数. 全面定制ros_navigation_stack基本能够完成机器人导航要求 Move_base Tuining前言参考任务要求学习记录基本调参指南确定激光或者声纳的完整性里程计的有效性定位的有效性代价地图局部规划器局部规划器原理各模块参数代价

Unity3D 渲染统计窗口

看到很多开发者习惯性的会打开Game视窗的Stats去查看渲染统计的信息, 但只会看一下Draw Calls数值,其他的信息也并没有什么体会: 其实里面的每一项都很重要,并值得学习和了解. 游戏开发优化之路 之 unity3D 渲染统计窗口 1.FPS fps其实就是 frames per second,也就是每一秒游戏执行的帧数,这个数值越小,说明游戏越卡. 2.Draw calls batching之后渲染mesh的数量,和当前渲染到的网格的材质球数量有关. 3.Saved by batch

BIEE11g BI_server Jvm参数调整

1.找到user_projects\domains\bifoundation_domain\bin目录 2.复制startWeblogic.sh为新的文件startAdminWeblogic.sh,复制setDomainEnv.sh到setAdminDomainEnv.sh,复制setOBIDomainEnv.sh到setAdminOBIDomain.sh 3.修改startAdminWeblogic.sh 我的机器是windows调用的脚本都是cmd的,linux下面肯定都是.sh文件,把调用

Air导出exe文件

FlashDevelop中Air导出exe文件,首先项目是As3Air项目,写好代码后,F5编译运行,会生成很多文件,bin和swf一样,里面是生成的swf,还有个air文件夹,包含了生成的air文件,现在的主要目标就是将这个air文件打包成exe文件.就要用到air sdk了. 首先打开cmd命令框,跳转到sdk路径,例如: D: cd flexsdk cd bin 则跳转到flexsdk的bin文件夹下: D:\flexsdk\bin 执行adt文件: adt -package -targe

Linux 内核参数 和 Oracle相关参数调整

Linux 内核参数 和 Oracle相关参数调整 分类: Oracle Basic Knowledge2009-10-14 12:23 9648人阅读 评论(0) 收藏 举报 oraclelinuxsemaphorearraysdatabaseoracle10g Linux 内核参数的大小和Oracle 有很大的关闭,比如ORA-27102的错误,就是因为内核参数的大小不当造成.具体参考Blog: Upon startup of Linux database get ORA-27102: ou

#调整随机森林的参数(调整max_features,结果未见明显差异)

#调整随机森林的参数(调整max_features,结果未见明显差异) from sklearn import datasets X, y = datasets.make_classification(n_samples=10000,n_features=20,n_informative=15,flip_y=.5, weights=[.2, .8]) import numpy as np training = np.random.choice([True, False], p=[.8, .2],

使用Unity3d做异形窗口

项目马上上线,因为之前的登录器是使用VS2010的MFC做的,在很多电脑上会提示缺失mfcXXXX.dll,中间找寻这种解决方案,最后确定将vcredist2010_x86和我的程序打包到安装包里面,每次安装的时候默认先安装vcredist2010_x86. 由此,经常被杀毒软件阻止,而且还有x64 or x86的区别. 同时,甲方想要一个精灵,类似于QQ宠物,于是PL决定使用精灵模型+异形窗口做一个桌面宠物.于是,异形窗口成了此物的基础. 首先,我们需要了解的是,异形窗口是什么.简单来说,即将

(二十七)unity4.6学习Ugui中文文档-------Unity3D UI (uGUI)窗口扩展

出处:http://blog.csdn.net/u010019717 下面是提供的例子: Unity3D UI (uGUI)窗口扩展 它是如何工作的? 也有官方的api文档: ?? ??