Unity3D实现点击物体旋转
2013-01-06 20:38
531 查看
using UnityEngine; using System.Collections; public class roated : MonoBehaviour { private bool roate; private float RoatedSpeed = 1000.0F; void Start () { roate = false; } // Update is called once per frame void Update () { if(Input.GetMouseButton(0)) { float y = 0; y = Input.GetAxis("Mouse X")*RoatedSpeed*Time.deltaTime; if(roate) { gameObject.transform.Rotate(new Vector3(0,y,0)); } } } void OnMouseDown() { roate =true; Debug.Log("collider"); } void OnMouseUp() { roate = false; Debug.Log("Out of collider"); } }
相关文章推荐
- Unity3D实现点击物体旋转和拖动
- 002-实现Unity3d中触摸屏幕控制物体的旋转和缩放 代码实现
- unity3D中物体实现任意角度自旋转
- unity3d实现3D物体上的点击事件
- UNITY3D 一行代码实现一个物体保持面向另一个物体(旋转)
- Unity3d物体模型(实现旋转缩放平移自动旋转)
- Unity3d实现物体围绕某一点进行旋转
- [原创]unity3D学习【功能实现】之二:图片的旋转/2d物体的旋转
- unity3D 实现NGUI物体朝鼠标点击位置移动
- Unity3d物体模型(实现旋转缩放平移自动旋转)
- unity3d实现相机对场景物体的旋转、缩放、平移查看功能、近似于scene下查看场景的效果
- Unity3d 简单实现物体旋转缩放移动
- Unity3D如何实现点击物体替换贴图。
- 在Unity3D中实现点击地面物体移动到指定地点
- unity3d5.1物体椭圆旋转选择界面实现(二)
- unity3D基础学习 通过判断鼠标点击的是否是目标物体,物体旋转,滑动滚轮缩放拉近视角
- unity3d5.1物体椭圆旋转选择界面实现(一)
- Unity3D之实现点击地形使物体移动到指定位置
- Unity3d物体模型(实现旋转缩放平移自动旋转)
- Unity3D 控制物体移动、旋转、缩放