摘要: 有了坦克之后再创造敌军坦克,随机生成并且向主坦克进攻。没有创造发射子弹以及敌人消失功能 阅读全文
posted @ 2016-10-29 17:01 扎北强子 阅读(404) 评论(0) 推荐(0)
摘要: using UnityEngine; using System.Collections; public class PlayerTrigger : MonoBehaviour { void OnTriggerEnter(Collider other) { Debug.Log ("Enter"); } 阅读全文
posted @ 2016-10-29 16:35 扎北强子 阅读(304) 评论(0) 推荐(0)
摘要: using UnityEngine; using System.Collections; public class RayCastDemo : MonoBehaviour { //射线碰撞检测器 RaycastHit hit; void Update() { //通过鼠标屏幕坐标,生成一条射线对象 Ray r = Camer... 阅读全文
posted @ 2016-10-29 16:31 扎北强子 阅读(208) 评论(0) 推荐(0)
摘要: 接物体的工具 创建掉落体的三个预设体 阅读全文
posted @ 2016-10-29 16:20 扎北强子 阅读(475) 评论(0) 推荐(0)
摘要: 要发射的子弹预设体 阅读全文
posted @ 2016-10-29 16:07 扎北强子 阅读(493) 评论(0) 推荐(0)
摘要: using UnityEngine; using System.Collections; public class CubeAddForce : MonoBehaviour { float hor,ver; //力的方向向量 Vector3 forceDir; //力的大小 public float 阅读全文
posted @ 2016-10-29 15:52 扎北强子 阅读(5904) 评论(0) 推荐(0)
摘要: 按键获取 WASD获取 阅读全文
posted @ 2016-10-29 15:44 扎北强子 阅读(218) 评论(0) 推荐(0)
摘要: using UnityEngine; using System.Collections; public class InitGameObject : MonoBehaviour { public GameObject bullet; void Update() { if (Input.GetKeyDown (KeyCode.Space)) { //通过预设体生成游戏对象(... 阅读全文
posted @ 2016-10-29 15:42 扎北强子 阅读(303) 评论(0) 推荐(0)
摘要: using UnityEngine; using System.Collections; public class CyCollision : MonoBehaviour { void OnCollisionEnter(Collision other) { // Debug.Log ("Enter"); // Debug.Log(other.col... 阅读全文
posted @ 2016-10-29 15:38 扎北强子 阅读(249) 评论(0) 推荐(0)
摘要: using UnityEngine; using System.Collections; public class CapsuleMove : MonoBehaviour { //方向 Vector3 dir; //上一帧的鼠标坐标 Vector3 begin; //当前帧的鼠标坐标 Vector3 end; public float speed = 3f; void O... 阅读全文
posted @ 2016-10-29 15:35 扎北强子 阅读(160) 评论(0) 推荐(0)