-
-
0unity3dURP渲染管线打包之后光泽度显示异常
-
0工作时写的一个简单的音频管理器,包含播放、暂停等功能 using System.Collections.Generic; using UnityEngine; public class AudioManager : Singleton<AudioManager> { protected AudioSource _audio; protected Dictionary<string, AudioClip> _audioClips = new Dictionary<string, AudioClip>(); //public static MonoBehaviour mono; public bool isplay = false; /// <summary> /// 初始化 /// </summary> protected override void _OnInit() { //mono = new MonoBehaviour(); LoadSounds("AllSounds"); _audio = GameObject.Find("GameManager").GetCo
-
21. 通过直接绑定脚本来绑定事件 (1) 建一个ButtonTest脚本,挂在一个游戏对象上(里面的方法public或private都可以). using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class ButtonTest : MonoBehaviour { private GameObject Obj; private void Start() { Obj = GameObject.Find("Button"); Obj.GetComponent<Button>().onClick.AddListener(Func1); Obj.GetComponent<Button>().onClick.AddListener(Func2); } void Func1() { print("执行了Func1方法!"); } public void Func2() { print("
-
0Table是Lua中唯一的一个数据结构,(自定义数据类型)通过table,我们能扩展出其他的数据结构,比如:数组,类。 构造器是创建和初始化表的表达式。表是Lua特有的功能强大的东西。最简单的构造函数是{},用来创建一个空表。可以直接初始化数组: -- 初始化表 mytable = {} -- 指定值 mytable[1]= "Lua" -- 移除引用 mytable = nil -- lua 垃圾回收会释放内存 当我们为 table a 并设置元素,然后将 a 赋值给 b,则 a 与 b 都指向同一个内存。如果 a 设置为 nil ,则 b 同样能访
-
0有些童鞋在开发中会感觉系统输入法的键盘太丑,或者是由于项目需求要是用自己制作的键盘来完成一些输入。这是本人在开发中遇到的问题,本人百度了好久都没有找到方法,这还要多谢一位大佬的帮忙才得以解决。接下来我就要说下我的解决办法:首先新建一个脚本HideVirtualKeyboard,继承于InputFeild,重写Start方法,在Start方法里修改keyboardType类型为-1,即不调用任何类型键盘 using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI
-
01 table.concat (table [, sep [, start [, end]]]): concat是concatenate(连锁, 连接)的缩写. table.concat()函数列出参数中指定table的数组部分从start位置到end位置的所有元素, 元素间以指定的分隔符(sep)隔开。 2 table.insert (table, [pos,] value): 在table的数组部分指定位置(pos)插入值为value的一个元素. pos参数可选, 默认为数组部分末尾. 3 table.maxn (table) 指定table中所有正数key值中最大的key值. 如果不存在key值为正数的元素, 则返回0。(Lua5.2之后该方法已经不存在了) 4 table.remove (table [, po
-
0广大unity开发者们,想必有很多已经从事unity多年了,当然也有一些刚刚接触unity,不管接触时间长短吧,想必大家都对unity有一定的了解,大家可以畅所欲言,说下自身对unity的看法,说下自己在从事unity以来所遇到的坑或者是奇闻趣事,大家都可以说下。
-
0亲爱的各位吧友:欢迎来到unity技术交流