- 博客(3)
- 收藏
- 关注
原创 Trying to Invoke method: CallZombies.Spawn couldn’t be called
Trying to Invoke method: CallZombies.Spawn couldn’t be called.解决办法:看看自己方法名写对了没 怎么写成了Spwan???void PrepareSpawn() { // 检测个数,是否继续生成 if(spawnPoint.childCount >= maxChildNum) { return; } // 血量太低停止召唤,召唤
2020-06-22 14:02:57 2099
原创 ugui获取UI物体的长和宽
宽:baigameObject.GetComponent().rect.width高:gameObject.GetComponent().rect.heightGetComponent().sizeDelta或者GetComponent().rect.size延展:UI(像素)坐标:RectTransform.position.x (0,0)表示最左下角的点
2020-06-21 12:25:42 1728
原创 Unity笔记:Unity射线(Ray)
Unity射线(Ray)是用来检测碰撞体或触发器的,不带碰撞体的是检测不到的,不检测触发器要在物理设置里设置表示bool值:Physics.Raycast(Ray, out hitInfo, range, mask){} 四个参数第一个必须要有Ray:射线(Vector3发射位置,Vector3发射方向)hitInfo:被击中的物体信息 通过hit.collider.tag判断物体,可用hitInfo.point获得击中点坐标,可通过hitInfo.position获取位置 进而获取物体等信息如:
2020-06-20 13:19:36 7638
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人