资源简介
本资源使用unity制作的虚拟手控制例子,通过按钮控制虚拟手的每个部件,内含unity完整工程文件(5.0)和运行效果gif图片。
代码片段和文件信息
using UnityEngine;
using System.Collections;
public class creatBtn : MonoBehaviour {
private
int posX = 20;
int posY = 50;
int size = 30;
int step = 200;
const int num = 20;
string[] buttonNamePos;
string[] buttonNameNeg;
// Use this for initialization
void Start () {
buttonNamePos = new string[num];
buttonNameNeg = new string[num];
for(int i=0; i buttonNamePos[i] = i+“+“;
buttonNameNeg[i] = i+“-“;
}
}
// Update is called once per frame
void Update () {
}
void OnGUI() {
if (GUI.Button(new Rect(20 128 size+10 size) “前“)){
Gameobject.Find(“hand“).transform.Translate(Vector3.up * Time.deltaTime * (-step));
}
if (GUI.Button(new Rect(20 166 size+10 size) “后“)){
Gameobject.Find(“hand“).transform.Translate(Vector3.up * Time.deltaTime * step);
}
if (GUI.Button(new Rect(65 128 size+10 size) “左“)){
Gameobject.Find(“hand“).transform.Translate(Vector3.right * Time.deltaTime * step);
}
if (GUI.Button(new Rect(65 166 size+10 size) “右“)){
Gameobject.Find(“hand“).transform.Translate(Vector3.right * Time.deltaTime * (-step));
}
if (GUI.Button(new Rect(110 128 size+10 size) “上“)){
Gameobject.Find(“hand“).transform.Translate(Vector3.forward * Time.deltaTime * (-step));
}
if (GUI.Button(new Rect(110 166 size+10 size) “下“)){
Gameobject.Find(“hand“).transform.Translate(Vector3.forward * Time.deltaTime * step);
}
if (GUI.Button(new Rect(155 128 size+10 size) “俯“)){
Gameobject.Find(“hand“).transform.Rotate(Vector3.right * Time.deltaTime * (-step));
}
if (GUI.Button(new Rect(155 166 size+10 size) “仰“)){
Gameobject.Find(“hand“).transform.Rotate(Vector3.right * Time.deltaTime * step);
}
if (GUI.Button(new Rect(200 128 size+10 size) “左摆“)){
Gameobject.Find(“hand“).transform.Rotate(Vector3.up * Time.deltaTime * (-step));
}
if (GUI.Button(new Rect(200 166 size+10 size) “右摆“)){
Gameobject.Find(“hand“).transform.Rotate(Vector3.up * Time.deltaTime * step);
}
if (GUI.Button(new Rect(245 128 size+10 size) “左旋“)){
Gameobject.Find(“hand“).transform.Rotate(Vector3.forward * Time.deltaTime * step);
}
if (GUI.Button(new Rect(245 166 size+10 size) “右旋“)){
Gameobject.Find(“hand“).transform.Rotate(Vector3.forward * Time.deltaTime * (-step));
}
for(int i=0; i if (GUI.Button(new Rect(posX+i*(size+5) posY size size) buttonNamePos[i])){
//button listener
if(i == 0){
Gameobject.Find(“dmz0“).transform.Rotate(Vector3.forward * Time.deltaTime * step);
}else if(i == 1){
Gameobject.Find(“dmz2“).transform.Rotate(Vector3.up * Time.deltaTime * (-step));
}else if(i == 2){
Gameobject.Find(“dmz3“).transform.Rotate(Vector3.up * Time.deltaTime * (-step));
}else if(i == 3){
Gameobject.Find(“dmz0“).transform.Rotate(Vector3.up * Time.deltaTime * (-step));
}else if(i == 4){//Vector3.right * Time.deltaTime);
Gameobject.Find(“sz0“).transform.Rotate(Vector3.
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 3787 2018-01-25 17:39 virtual hand\Assembly-CSharp-vs.csproj
文件 3787 2018-01-25 17:39 virtual hand\Assembly-CSharp.csproj
文件 7301 2018-01-25 18:59 virtual hand\Assets\Assembly-CSharp.pidb
..A..H. 174 2018-01-25 17:14 virtual hand\Assets\Assembly-CSharp.pidb.me
文件 74844 2018-01-24 11:24 virtual hand\Assets\materials\pic\sky.jpg
..A..H. 1187 2018-01-25 17:37 virtual hand\Assets\materials\pic\sky.jpg.me
..A..H. 191 2018-01-25 17:36 virtual hand\Assets\materials\pic.me
文件 5052 2018-01-25 18:11 virtual hand\Assets\materials\skybox.mat
..A..H. 179 2018-01-25 17:37 virtual hand\Assets\materials\skybox.mat.me
..A..H. 191 2018-01-25 17:36 virtual hand\Assets\materials.me
文件 1541316 2018-01-25 17:16 virtual hand\Assets\models\hand.3DS
..A..H. 3467 2018-01-25 17:15 virtual hand\Assets\models\hand.3DS.me
文件 4944 2018-01-25 18:11 virtual hand\Assets\models\Materials\HAND.mat
..A..H. 179 2018-01-25 17:15 virtual hand\Assets\models\Materials\HAND.mat.me
..A..H. 191 2018-01-25 17:15 virtual hand\Assets\models\Materials.me
..A..H. 191 2018-01-25 14:18 virtual hand\Assets\models.me
文件 19508 2018-01-25 18:58 virtual hand\Assets\scence\hand.unity
..A..H. 174 2018-01-25 17:30 virtual hand\Assets\scence\hand.unity.me
..A..H. 191 2018-01-25 14:28 virtual hand\Assets\scence.me
文件 7008 2018-01-25 18:58 virtual hand\Assets\sc
..A..H. 262 2018-01-25 17:39 virtual hand\Assets\sc
..A..H. 191 2018-01-25 14:28 virtual hand\Assets\sc
I.A.... 4120 2018-01-25 14:16 virtual hand\Library\AnnotationManager
I.A.... 989304 2018-01-25 18:58 virtual hand\Library\assetDataba
I.A.... 6 2018-01-25 14:16 virtual hand\Library\AssetImportState
I.A.... 4756 2018-01-25 18:58 virtual hand\Library\AssetServerCacheV3
I.A.... 14336 2018-01-25 17:14 virtual hand\Library\AssetVersioning.db
I.A.... 0 2018-01-25 14:16 virtual hand\Library\BuildPla
I.A.... 4124 2018-01-25 14:16 virtual hand\Library\BuildSettings.asset
I.A.... 36936 2018-01-25 18:59 virtual hand\Library\CurrentLayout.dwlt
............此处省略387个文件信息
- 上一篇:苹果解ID解锁
- 下一篇:COMSOL光学仿真专题
相关资源
- unity3d武器拖尾特效
- 在Unity中整合LUA的DEMO
- NGUI版的虚拟摇杆
- Unity3d调色板
- Graph Maker1.3
- Unity3D期末
- SilverLining Skies 3D Clouds v1.9.unitypackage
- Unity3D 角色控制器CharacterController
- NavMesh 2D.unitypackage
- unity3d串口数据显示.docx
- Dynamic Bone V1.2.2
- Unity3d常用中文字体
- 鱼游动逻辑算法
- Unity 3D小游戏
- Unity3d传送门模型
- Unity3d UGUI
- unity3d 美食游戏模板
- Unity刮刮乐效果、绘制透明工程
- unity3d答题系统
- unity3d 一个简单的足球demo
- SimplePath 1.11(最新完整版)
- leapmotion拼图
- unity3d rain 下雨 效果 特效 package
- unity3d分屏效果
- 帽子接球-Unity3D-源码及详细文档
- Water+2D+Kit+v1.1
- unity传送门特效粒子
- Unity3D 旋转相机视角 镜头缩放 拖动相
- 基于Unity3D多人斗地主毕设论文
- 水面效果插件TasharenWater.zip
评论
共有 条评论