标签:body getc 返回 game nbsp for color gid nsf
一,如下代码,
GameObject b = GameObject.Instantiate(bullet, transform.position, transform.rotation) as GameObject; Rigidbody rgd = b.GetComponent<Rigidbody>(); rgd.velocity = transform.forward * speed;
二,由于GameObject.Instantiate返回的类型是object所以我们需要as GameObject强转类型,我们定义一个刚体对象,并给刚体一个朝前面的速度
标签:body getc 返回 game nbsp for color gid nsf
原文地址:https://www.cnblogs.com/May-day/p/8870813.html