摘要:
一:获取对象, 添加对象等1:使用prefab生成对象 GameObject ballObj = GameObject.Instantiate(Resources.Load("Fx/fx_bullet001"), transform.position + transform.forward * -0.8f + transform.up * 2, Quaternion.identity) as GameObject;2:添加脚本到对象, 并更改脚本值 ballObj.AddComponent ("BasicGun"); BasicGun pScript = 阅读全文