-
大小: 13.83MB文件类型: .rar金币: 1下载: 0 次发布日期: 2023-06-29
- 语言: Java
- 标签: unity3d touchscript 多点触摸
资源简介
touchscript可支持win7,win8,android,ios,tuio等多点触摸,里面有例子。
代码片段和文件信息
using UnityEngine;
using System.Collections;
/// MouseLook rotates the transform based on the mouse delta.
/// Minimum and Maximum values can be used to constrain the possible rotation
/// To make an FPS style character:
/// - Create a capsule.
/// - Add the MouseLook script to the capsule.
/// -> Set the mouse look to use LookX. (You want to only turn character but not tilt it)
/// - Add FPSInputController script to the capsule
/// -> A CharacterMotor and a CharacterController component will be automatically added.
/// - Create a camera. Make the camera a child of the capsule. Reset it‘s transform.
/// - Add a MouseLook script to the camera.
/// -> Set the mouse look to use LookY. (You want the camera to tilt up and down like a head. The character already turns.)
[AddComponentMenu(“Camera-Control/Mouse Look“)]
public class MouseLook : MonoBehaviour {
public enum RotationAxes { MouseXAndY = 0 MouseX = 1 MouseY = 2 }
public RotationAxes axes = RotationAxes.MouseXAndY;
public float sensitivityX = 15F;
public float sensitivityY = 15F;
public float minimumX = -360F;
public float maximumX = 360F;
public float minimumY = -60F;
public float maximumY = 60F;
float rotationY = 0F;
void Update ()
{
if (axes == RotationAxes.MouseXAndY)
{
float rotationX = transform.localEulerAngles.y + Input.GetAxis(“Mouse X“) * sensitivityX;
rotationY += Input.GetAxis(“Mouse Y“) * sensitivityY;
rotationY = Mathf.Clamp (rotationY minimumY maximumY);
transform.localEulerAngles = new Vector3(-rotationY rotationX 0);
}
else if (axes == RotationAxes.MouseX)
{
transform.Rotate(0 Input.GetAxis(“Mouse X“) * sensitivityX 0);
}
else
{
rotationY += Input.GetAxis(“Mouse Y“) * sensitivityY;
rotationY = Mathf.Clamp (rotationY minimumY maximumY);
transform.localEulerAngles = new Vector3(-rotationY transform.localEulerAngles.y 0);
}
}
void Start ()
{
// Make the rigid body not change rotation
if (rigidbody)
rigidbody.freezeRotation = true;
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 5475 2014-04-30 15:47 touchsc
文件 5522 2014-04-30 15:47 touchsc
文件 3627 2014-04-30 15:47 touchsc
文件 3627 2014-04-30 15:47 touchsc
文件 5301 2014-04-30 15:47 touchsc
文件 5354 2014-04-30 15:47 touchsc
文件 4088 2014-04-30 15:47 touchsc
文件 4088 2014-04-30 15:47 touchsc
I.A.... 35107 2014-01-23 09:09 touchsc
..A..H. 95 2014-04-30 15:47 touchsc
I.A.... 16704 2014-01-23 09:09 touchsc
..A..H. 95 2014-04-30 15:47 touchsc
I.A.... 3694928 2014-01-23 09:09 touchsc
..A..H. 7667 2014-04-30 15:47 touchsc
I.A.... 3723 2014-01-23 09:09 touchsc
..A..H. 95 2014-04-30 15:47 touchsc
..A..H. 107 2014-04-30 15:47 touchsc
I.A.... 694161 2014-01-23 09:09 touchsc
..A..H. 914 2014-04-30 15:47 touchsc
I.A.... 1260365 2014-01-23 09:09 touchsc
..A..H. 912 2014-04-30 15:47 touchsc
..A..H. 107 2014-04-30 15:47 touchsc
..A..H. 107 2014-04-30 15:47 touchsc
I.A.... 21567 2014-01-23 09:09 touchsc
..A..H. 178 2014-04-30 15:47 touchsc
I.A.... 1438 2014-01-23 09:09 touchsc
..A..H. 178 2014-04-30 15:47 touchsc
I.A.... 2037 2014-01-23 09:09 touchsc
..A..H. 178 2014-04-30 15:47 touchsc
I.A.... 2619 2014-01-23 09:09 touchsc
............此处省略614个文件信息
相关资源
- Unity3D高德地图SDK演示apk
- Unity3D游戏开发中文版
- Unity调用Android系统相册
- AVPro Video 1.11.4.zip
- UMP (Android iOS) v1.7.2.1
- Unity3D武士2源码扩展插件
- Unity代码混淆加密插件 Obfuscator v2.0.
- mst Android多点触摸屏的native service参考
- unity3D 蓝牙插件 iOS & Android
- Unity3D AR生存射击游戏 完整源码 AR S
- EasyMovieTexture 3.77-1.unitypackage
- AssetStudio
- 图片手势滑动,多点触摸放大缩小 程
- Unity3D 超级宝库]Unity滑动切换效果插件
评论
共有 条评论