当前位置:网站首页>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);
}
}
}
边栏推荐
- How to successfully pass the senior system architecture designer in the second half of the year?
- Leetcode-303: region and retrieval - array immutable
- 路由器开发知识汇总
- MONAI版本更新到 0.9 啦,看看有什么新功能
- 软考中级有用吗??
- Network engineer test questions and answers in May of the first half of 2022
- 香橙派OrangePi 4 LTS开发板通过Mini PCIE连接SATA硬盘的操作方法
- 施努卡:机器人视觉抓取工作原理 机器视觉抓取
- Typescript interface inheritance
- JS实现链式调用
猜你喜欢

Find the root of equation ax^2+bx+c=0 (C language)

Mendeley -- a free document management tool that automatically inserts references into papers

Socket通信原理和实践

原型与原型链

Mendeley--免费的文献管理工具,给论文自动插入参考文献
![[recommendation system 02] deepfm, youtubednn, DSSM, MMOE](/img/d5/33765983e6b98235ca085f503a1272.png)
[recommendation system 02] deepfm, youtubednn, DSSM, MMOE

Monai version has been updated to 0.9. See what new functions it has

高级软考(网络规划设计师)该如何备考?

如何顺利通过下半年的高级系统架构设计师?

软考信息处理技术员有哪些备考资料与方法?
随机推荐
Basic introduction of yarn and job submission process
Use load_ decathlon_ Datalist (Monai) fast loading JSON data
gym安装踩坑记录
原型与原型链
5个chrome简单实用的日常开发功能详解,赶快解锁让你提升更多效率!
Différences entre les contraintes monotones et anti - monotones
CC2530 zigbee IAR8.10.1环境搭建
The difference between monotonicity constraint and anti monotonicity constraint
PHP \ newline cannot be output
无法打开内核设备“\\.\VMCIDev\VMX”: 操作成功完成。是否在安装 VMware Workstation 后重新引导? 模块“DevicePowerOn”启动失败。 未能启动虚拟机。
IDA中常见快捷键
关于easyflash v3.3使用过程的记录
Simple and easy to modify spring frame components
Some online academic report websites and machine learning videos
Applet jump to H5, configure business domain name experience tutorial
Find the greatest common divisor and the least common multiple (C language)
I plan to take part in security work. How about information security engineers and how to prepare for the soft exam?
What is an intermediate network engineer? What is the main test and what is the use?
MySQL insert data create trigger fill UUID field value
SQL Server 知识汇集11 : 约束