2015-7-4
来源:互联网 发布:语音变声器软件 编辑:程序博客网 时间:2024/06/09 22:14
using UnityEngine;using System.Collections;public class sjt2 : MonoBehaviour {// Use this for initializationvoid Start () {}// Update is called once per framevoid Update () {transform.position += new Vector3 (1, 0, 0) * Time.deltaTime;// 物体一直朝向x轴移动}}
</pre><pre name="code" class="cpp"><pre name="code" class="cpp">using UnityEngine;using System.Collections;public class NewBehaviourScript : MonoBehaviour {//public sjt(float x, float y);// 构造体Transform tran;// 主界面help //// Debug.Log(); // 打印// Use this for initializationvoid Start () {// 执行一次//Do();tran = this.gameObject.GetComponent<Transform>();//float posX = tran.position.x;//tran.position.x = 5;// errortran.position = new Vector3 (0, 0, 0);transform.position = new Vector3 (1, 1, 1);transform.localPosition = new Vector3 (1,1,1);// 界面属性上的position //transform.rotation = new Quaternion (30, 30, 30, 30);transform.localEulerAngles = new Vector3 (0, 30, 0);// 修改 Rotation transform.localScale = new Vector3 (2,2,2);// 局部缩放属性// this,指脚本 this 是c#的关键词// gameObject 所挂载的对象// Component 组件// Transform 指 泛型 http://baike.baidu.com/link?url=Uuau1uqsT-Ed_tzBB3QdLUnoelxdsCGgIWQICAsvm4ZABqZp8g1JFEmimc0IWXfXys9sVXTSslCyM21mJFNOqa}//void Do(string sjt)//{//int resultNum = num1 / num2;//Debug.Log(resultNum);//print (resultNum);//}// Update is called once per framevoid Update ()// 物体所有动的操作都要写到 Update({//print ("nihao!");}void OnGui(){GUI.skin.label.fontSize = 100;GUI.Label (new Rect(10, 10, Screen.width, Screen.height), "Hello World");}}
<pre name="code" class="cpp">using UnityEngine;using System.Collections;public class MainPlayer : MonoBehaviour {float move = 1;// Use this for initializationvoid Start () {}// Update is called once per framevoid Update () {if(Input.GetKey(KeyCode.RightArrow)){//this.transform.Translate (new Vector2(move, 0));this.gameObject.transform.position += new Vector3(1,0,0)*move *Time.deltaTime;}}}
0 0
- 2015-7-4
- 2015-4-7 中度贫血 食记
- Java 学习笔记 2015-4-7
- 2015-4-7C语言学习日记
- 2015年7月4日单词
- 2015年4月7号的日志
- 小知识点日志(2014-10-22~2015-4-7)
- 2015-7-7 小记
- 【2015/4/21】servlet学习笔记7---tomcat的配置(数据源和连接池)
- 2015年大一下第7周项目4-我的向量类
- 自学笔记-C语言复习2015年7月4日
- 2015-1-7
- 2015-基础(7)
- 3/7/2015
- 蓝桥杯2015培训(7)
- 蓝桥杯2015培训(7)
- 杂记2015-5-7
- 2015/5/7
- 初探springmvc
- 通过IF({1,0}和VLOOKUP函数实现Excel的双条件多条件查找
- centos7 创建桌面快捷方式(chrome,eclipse)
- hdu 2571 命运
- js的数组ECMAScript 5加入的方法(二)
- 2015-7-4
- udp服务端和客户端程序示例
- android sqlite 数据类型
- 深入java单例模式(转)
- 每天一个linux命令(11):nl命令
- 2015070710 - 晚11早4作息
- 回调机制详解
- Two Sum
- C++template元编程学习心得--数据类型