在滑动3D模型(Cube)时,手指点击进入相应的某一部分
2024-08-31 17:35:34
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"); } } }
以上是具体实现代码
具体实现方法:
通过射线判断确定点击的是哪一部分
最新文章
- [转]C#程序无法在64位系统上运行之.NET编译的目标平台
- javascript基础语法——词法结构
- SQL 性能调优日常积累
- 让input框只能输入数字
- Andrew Ng机器学习公开课笔记 -- Mixtures of Gaussians and the EM algorithm
- JS正则实例
- poj - 2774 - Long Long Message
- 重构9-Extract Interface(提取接口)
- dynamips虚拟服务:找不到指定设备
- ajaxPro用法
- ITextSharp 初次接触
- 相对路径和绝对路径的问题";/";带不带斜杠
- 到底什么是集群&;分布式
- mobile_缩放
- Android 获取keystore SHA1方法
- Maven Nexus3 安装,私服搭建
- javascript 原型继承
- android 中遇到 imageView getWidth 始终为0 时 ,设置 setImageBitmap 的方法
- Gson(Google)基础
- Spring+hibernate+mysql事物不回滚的原因以及处理
热门文章
- [bzoj1901][Zju2112]Dynamic Rankings_主席树
- [bzoj3694]最短路_树链剖分_线段树
- PMVS学习中学习c++
- ustc 1117
- linux下环境变量C_INCLUDE_PATH
- 前台JSON字符串,spring mvc controller也接收字符串
- AOP代理分析
- linux更改gitlab存储位置
- android自带的处理Bitmap out Memory 的处理,我仅仅是改变了些写法成为自己用的东西
- ubuntu下eclipse连接mysql