Пример #1
0
    // Update is called once per frame
    void Update()
    {
        mousePos = Input.mousePosition;

        if (Input.GetKeyDown(KeyCode.Space) || Input.GetButtonDown("Fire1"))
        {
            // 开始射击
            bulletSpw.SpawnON();
        }
        if (Input.GetKeyUp(KeyCode.Space) || Input.GetButtonUp("Fire1"))
        {
            // 停止射击
            bulletSpw.SpawnOFF();
        }
    }