摘要: using UnityEngine; using System.Collections; public class test : MonoBehaviour { //print只能在MonoBehavior的子类中使用,否则只能使用Debug.log() public int age; public string name; //每当脚本被加载时调用;“有添加... 阅读全文
posted @ 2016-07-19 22:32 吴筱军 阅读(1292) 评论(0) 推荐(0) 编辑
摘要: using UnityEngine; using System.Collections; public class test1 : MonoBehaviour { public float angleSpeed; void Update () { if(Input.GetKeyDown(KeyCode.UpArrow)) { ... 阅读全文
posted @ 2016-07-19 22:21 吴筱军 阅读(209) 评论(0) 推荐(0) 编辑
摘要: using UnityEngine; using System.Collections; public class test : MonoBehaviour { void Start () { Vector3 v = new Vector3(); float x = v.x; float y = v.y; float z ... 阅读全文
posted @ 2016-07-19 22:13 吴筱军 阅读(2475) 评论(0) 推荐(0) 编辑
摘要: using UnityEngine; using System.Collections; public class transform : MonoBehaviour { // Use this for initialization void Start () { //获取当前脚本所挂载的游戏对象身上的Transform //控制游戏对象的位置... 阅读全文
posted @ 2016-07-19 21:58 吴筱军 阅读(282) 评论(0) 推荐(0) 编辑
摘要: using UnityEngine; using System.Collections; public class destroy : MonoBehaviour { void Start () { print("start"); destroyObject(); //destroyImmediateObj(); ... 阅读全文
posted @ 2016-07-19 00:13 吴筱军 阅读(403) 评论(0) 推荐(0) 编辑
摘要: using UnityEngine; using System.Collections; public class hitCheck : MonoBehaviour { //两个物体能发生碰撞的条件是:两个都带有collider且其中一个是刚体。 // Use this for initialization void Start () { } ... 阅读全文
posted @ 2016-07-19 00:12 吴筱军 阅读(377) 评论(0) 推荐(0) 编辑
摘要: using UnityEngine; using System.Collections; public class mouse : MonoBehaviour { //private Vector3 lasePos; private Vector3 offSet; private Vector3 ScreenSpace; //1. void OnMous... 阅读全文
posted @ 2016-07-19 00:11 吴筱军 阅读(7023) 评论(0) 推荐(0) 编辑
摘要: using UnityEngine; using System.Collections; public class rigidbody_ : MonoBehaviour { private Rigidbody r; void Start () { //Rigidbody rb = GetComponent(); //float mass = rb... 阅读全文
posted @ 2016-07-19 00:07 吴筱军 阅读(268) 评论(0) 推荐(0) 编辑