
Unity相关
文章平均质量分 71
栗林
这个作者很懒,什么都没留下…
展开
-
在Unity中利用WinAPI实现在任何地方可以拖拽窗体
大概很少有人需要这种需求吧,不废话,贴代码.using UnityEngine;using System.Runtime.InteropServices;using System;public class WinApi : MonoBehaviour { [DllImport("user32.dll")] private static extern IntPtr Ge原创 2016-09-11 19:23:16 · 702 阅读 · 0 评论 -
利用反射在Unity的EditorMode下播放音频
using System;using System.Reflection;using UnityEditor;using UnityEngine;namespace UnityEditor { public static class AudioUtility { public static void PlayClip(AudioClip clip , int startSampl原创 2016-09-11 19:36:30 · 1218 阅读 · 0 评论 -
Unity下利用WinAPI打开FileDialog
using UnityEngine;using System.Runtime.InteropServices;using System;public class WinAPITest : MonoBehaviour{ [DllImport("Comdlg32.dll", SetLastError = true, ThrowOnUnmappableChar = true, Ch原创 2016-09-11 20:06:22 · 442 阅读 · 0 评论 -
Unity实用类之一:ScriptableObject类
ScriptableObject类可以将一个类的实例储存在Unity引擎中.我在AudioUtility中便使用这个类来储存音频配置信息.此类的属性也可以在Inspector中重写.下面为创建ScriptableObject文件代码. public static void CreateAsset() where T : ScriptableObject原创 2016-09-11 20:11:54 · 847 阅读 · 0 评论 -
Unity预编译宏定义
平台定义UNITY_EDITOR 编辑器调用。UNITY_STANDALONE_OSX 专门为Mac OS(包括Universal,PPC和Intelarchitectures)平台的定义。UNITY_DASHBOARD_WIDGET Mac OS Dashboard widget (Mac OS仪表板小部件)。UNITY_STANDALONE_WIN Window转载 2016-09-10 05:41:30 · 1161 阅读 · 0 评论