public void OnClickRay()
{
Ray ray = new Ray();
RaycastHit shootHit;
ray.origin = cameras.transform.position;
ray.direction =cubes.transform.position-cameras.transform.position;
if(Physics.Raycast(ray,out shootHit))
{
string ShitName = shootHit.collider.gameObject.name;
if (ShitName == "4GCUbe")
{
ShowUI(UI.RESULT);
ShowChild(Access4G, "4GAccess");
}
else if(ShitName== "5GCUbe")
{
ShowUI(UI.INPUTNAME);
ShowChild(Access5G, "5GAccess"); }
else if(ShitName== "IndoorCUbe")
{
ShowUI(UI.FORU);
PassiveeDistrbution.SetActive(false);
ShowChild(ActiveDistrbution, "Active Distribution"); }
else if(ShitName == "SateelliteCUbe")
{
ShowUI(UI.FOTDS);
ShowChild(Satilite, "Satilite"); } } }

以上是具体实现代码

具体实现方法:

通过射线判断确定点击的是哪一部分

最新文章

  1. [转]C#程序无法在64位系统上运行之.NET编译的目标平台
  2. javascript基础语法——词法结构
  3. SQL 性能调优日常积累
  4. 让input框只能输入数字
  5. Andrew Ng机器学习公开课笔记 -- Mixtures of Gaussians and the EM algorithm
  6. JS正则实例
  7. poj - 2774 - Long Long Message
  8. 重构9-Extract Interface(提取接口)
  9. dynamips虚拟服务:找不到指定设备
  10. ajaxPro用法
  11. ITextSharp 初次接触
  12. 相对路径和绝对路径的问题"/"带不带斜杠
  13. 到底什么是集群&分布式
  14. mobile_缩放
  15. Android 获取keystore SHA1方法
  16. Maven Nexus3 安装,私服搭建
  17. javascript 原型继承
  18. android 中遇到 imageView getWidth 始终为0 时 ,设置 setImageBitmap 的方法
  19. Gson(Google)基础
  20. Spring+hibernate+mysql事物不回滚的原因以及处理

热门文章

  1. [bzoj1901][Zju2112]Dynamic Rankings_主席树
  2. [bzoj3694]最短路_树链剖分_线段树
  3. PMVS学习中学习c++
  4. ustc 1117
  5. linux下环境变量C_INCLUDE_PATH
  6. 前台JSON字符串,spring mvc controller也接收字符串
  7. AOP代理分析
  8. linux更改gitlab存储位置
  9. android自带的处理Bitmap out Memory 的处理,我仅仅是改变了些写法成为自己用的东西
  10. ubuntu下eclipse连接mysql