炮塔 跟随
来源:互联网 发布:我的世界手机版js枪械 编辑:程序博客网 时间:2024/04/29 16:48
using UnityEngine;
using System.Collections;
public class lookat : MonoBehaviour {
public Transform target;
public GameObject bulletprafbs;
public Transform shootpoint;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
transform.LookAt(target); //此脚本加在带着炮管的球=transform/ target=鼠标移动的胶囊体
GameObject obj = Instantiate(bulletprafbs, shootpoint.position, transform.rotation)as GameObject; //obj =炮弹小球
Destroy(obj, 2);
}
}
***********************************************************************************
using UnityEngine;
using System.Collections;
public class BulletMove : MonoBehaviour {
public float speed =0.1f;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
transform.Translate(transform.forward * Time.deltaTime * speed,Space.World); //transform=炮弹小球 此脚本加在小球上
//transform.Translate(transform.forward * Time.deltaTime * speed, Space.World);
}
}
- 炮塔 跟随
- 四、创建炮塔
- 【jzoj5057】【炮塔】【网络流】
- 炮塔的转向
- 实现炮塔打兵
- 【JZOJ5057】【GDSOI2017模拟4.13】炮塔
- Unity中刚体使用--坦克炮塔旋转
- Cocos2D旋转炮塔到指定角度(一)
- Cocos2D旋转炮塔到指定角度(二)
- Cocos2D旋转炮塔到指定角度(三)
- 【GDSOI2017模拟4.13】炮塔 最小割
- 【GDSOI2017模拟4.13】炮塔(最小割)
- 孤独跟随
- 跟随内心
- 跟随大师
- 不跟随
- 敌人跟随
- 图片跟随
- 有自学前端开发的小伙伴儿吗?
- hdu 3980 Paint Chain
- TCP协议与UDP协议的区别
- hdu 6140 阅读理解
- 系统状态栏字体颜色更改
- 炮塔 跟随
- CentOS 7 下搭建 STF 环境
- php获取ua的微信版本号
- C++贪心算法之删数问题
- maven的学习---创建web项目及继承概念(三)
- 启动hadoop,报错Error JAVA_HOME is not set and could not be found
- noip2014D1T2联合权值题解
- 是时候用 NoHttp 来替换 Volley 了
- show running-config命令