Script-点击鼠标左键触发

作者: zcwfeng | 来源:发表于2017-08-31 13:48 被阅读8次
    public class Test : MonoBehaviour {
        public GameObject getBulle;
    
        GameObject bullet;
    
        // Use this for initialization
        void Start () {
            
        }
        
        // Update is called once per frame
        void Update () {
            if (Input.GetButton ("Fire1")) {
                bullet =  Instantiate (getBulle);
                bullet.transform.parent = this.transform;
            }
        }
    }
    
    

    相关文章

      网友评论

        本文标题:Script-点击鼠标左键触发

        本文链接:https://www.haomeiwen.com/subject/sadqjxtx.html