当前位置:网站首页>Realize ray detection, drag the mouse to move the object and use the pulley to scale the object
Realize ray detection, drag the mouse to move the object and use the pulley to scale the object
2022-07-07 10:48:00 【HCC2017】
public class Script : MonoBehaviour {
public GameObject obj;
public float s;
void Update () {
Ray ray = new Ray();
RaycastHit hit;
ray = Camera.main.ScreenPointToRay(Input.mousePosition);
if (Input.GetMouseButton(0))
{
if (Physics.Raycast(ray,out hit,100))
{
obj.transform.position = new Vector3(hit.point.x,hit.point.y,0);
}
}
if (Input.GetAxis("Mouse ScrollWheel") < 0)
{
s += Input.GetAxis("Mouse ScrollWheel");
obj.transform.localScale = new Vector3(s, s, s);
}
if (Input.GetAxis("Mouse ScrollWheel") > 0)
{
s += Input.GetAxis("Mouse ScrollWheel");
obj.transform.localScale = new Vector3(s, s, s);
}
}
}
边栏推荐
- 小程序跳转H5,配置业务域名经验教程
- CSAPP Bomb Lab 解析
- String formatting
- [detailed explanation of Huawei machine test] tall and short people queue up
- 南航 PA3.1
- Mendeley -- a free document management tool that automatically inserts references into papers
- 【亲测可行】error while loading shared libraries的解决方案
- openinstall与虎扑达成合作,挖掘体育文化产业数据价值
- gym安装踩坑记录
- 无法打开内核设备“\\.\VMCIDev\VMX”: 操作成功完成。是否在安装 VMware Workstation 后重新引导? 模块“DevicePowerOn”启动失败。 未能启动虚拟机。
猜你喜欢
![[pro test feasible] error while loading shared libraries solution](/img/e2/688ffa07861f38941cbf2cafdd9939.png)
[pro test feasible] error while loading shared libraries solution

【亲测可行】error while loading shared libraries的解决方案

路由器开发知识汇总

【实战】霸榜各大医学分割挑战赛的Transformer架构--nnFormer
![1324: [example 6.6] integer interval](/img/5d/29db4d51ec7a2685f8aeffe5be68da.png)
1324: [example 6.6] integer interval

深入分析ERC-4907协议的主要内容,思考此协议对NFT市场流动性意义!

Socket通信原理和实践

Multithreaded asynchronous orchestration

Summary of router development knowledge

CSAPP bomb lab parsing
随机推荐
Schnuka: machine vision positioning technology machine vision positioning principle
软考信息处理技术员有哪些备考资料与方法?
555 circuit details
小程序跳转H5,配置业务域名经验教程
【OneNote】无法连接到网络,无法同步问题
Monai version has been updated to 0.9. See what new functions it has
1323: [example 6.5] activity selection
Pre knowledge reserve of TS type gymnastics to become an excellent TS gymnastics master
[installation system] U disk installation system tutorial, using UltraISO to make U disk startup disk
软考中级,软件设计师考试那些内容,考试大纲什么的?
China Southern Airlines pa3.1
枪出惊龙,众“锁”周之
[recommendation system 02] deepfm, youtubednn, DSSM, MMOE
Using U2 net deep network to realize -- certificate photo generation program
OpenGL glLightfv 函数的应用以及光源的相关知识
宁愿把简单的问题说一百遍,也不把复杂的问题做一遍
使用Tansformer分割三维腹部多器官--UNETR实战
【STM32】实战3.1—用STM32与TB6600驱动器驱动42步进电机(一)
Multithreaded asynchronous orchestration
String formatting