摘要:
在使用foreach遍历dictionary字典时,如果对其进行add,Remove等操作,就会提示InvalidOperationException: out of sync错误。 因为使用foreach遍历的数据只可读,不可写。因此,可以将需要操作的Key或Value保存下来,然后在foreac 阅读全文
摘要:
协程函数如下,其中time为总的时间, IEnumerator WaitForReborn(int time) { rebornTime = time;//rebornTime为需要在UI上显示的Text while (time > 0) { yield return new WaitForSeco 阅读全文
摘要:
background=transform.Find("Background")//获得背景的Transform组件 Tweener tweener = background.DOLocalMoveY(0, 1).SetEase(Ease.OutBack).SetAutoKill(false).Pau 阅读全文
摘要:
制作按钮的过程中,发现鼠标点下按钮离开后,按钮还是处于Highlighted状态,只有再点击一次其他地方,按钮才会回复正常的状态。而我们想要的是鼠标离开按钮后恢复原有的状态。解决的方法就是把Navigation设置成None 阅读全文
摘要:
由于transform.rotation是 Quaternion类型,并不能像transform.position一样通过直接给rotation赋值Vector3(X,Y,Z),但是通过transform.localEulerAngles我们可以直接改变rotation的值,如transform.l 阅读全文