示例#1
0
文件: Gun.cs 项目: nick55660711/VR
    public void shoot()
    {
        GameObject BulletAll;

        BulletAll = Instantiate(bullet, GunPoint.position, GunPoint.rotation);
        BulletAll.GetComponent <Rigidbody>().AddForce(transform.forward * 1000);
        BulletAll.GetComponent <Rigidbody>().AddForce(transform.up * 70, ForceMode.Force);
        Destroy(BulletAll, 5);
    }
示例#2
0
文件: Gun.cs 项目: nick55660711/VR
 private void Update()
 {
     if (Input.GetKeyDown("t"))
     {
         GameObject BulletAll;
         BulletAll = Instantiate(bullet, GunPoint.position, GunPoint.rotation);
         BulletAll.GetComponent <Rigidbody>().AddForce(transform.forward * 2000);
         BulletAll.GetComponent <Rigidbody>().AddForce(transform.up * 70, ForceMode.Force);
     }
 }