2014年4月9日

unity3D中用js实现物体的旋转、移动

摘要: #pragma strictvar TranslaSpeed=20;var RotateSpeed=1000;function Start () {}function Update () {}function OnGUI(){GUI.backgroundColor=Color.red;if(GUI.Button(Rect(10,10,70,30),"向左旋转")){transform.Rotate(Vector3.up*Time.deltaTime*(-RotateSpeed));}if(GUI.Button(Rect(90,10,70,30),"向前移动&quo 阅读全文

posted @ 2014-04-09 13:32 连一粝 阅读(579) 评论(0) 推荐(0) 编辑

unity3d中最简单物体的旋转移动

摘要: voidAwake(){}//初始化函数,在游戏开始时系统自动调用。一般用来创建变量之类的东西。voidStart(){}//初始化函数,在所有Awake函数运行完之后(一般是这样,但不一定),在所有Update函数前系统自动条用。一般用来给变量赋值。我们通常书写的脚本,并不会定义[ExecuteInEditMode]这个Attribute,所以Awake和Start都只有在Runtime中才会执行。using UnityEngine;using System.Collections;public class square1 : MonoBehaviour { public float ... 阅读全文

posted @ 2014-04-09 11:18 连一粝 阅读(417) 评论(0) 推荐(0) 编辑

导航