如何获取鼠标点击的物体的名字 求大神支援
unity3d吧
全部回复
仅看楼主
level 9
2014年07月24日 08点07分 1
level 12
ray = Camera.main.ScreenPointToRay(Input.mousePosition);
if (Physics.Raycast(ray, out rayhit))
{
debug.log(rayhit.transform.name);
}
2014年07月24日 08点07分 2
谢谢
2014年07月24日 09点07分
大神 我在问一下 如何用代码来控制脚本的添加 删除 比如 有多个物体点击其中一个就给他添加点击另一个就把原来的删掉再给现在的添加??
2014年07月24日 09点07分
回复 最爱JhonJRambo :gameObject.AddComponent("XXXXX")
2014年07月24日 10点07分
谢谢大佬[真棒]
2023年06月15日 11点06分
1