private void HandleShoot() { if (Input.GetButton(shootBtnName)) { Debug.Log(shootBtnName + "Click!"); GameObject bulletGO = GameObject.Instantiate(bulletPrefab); bulletGO.transform.position = muzzleTrans.position; bulletMoveForward = bulletGO.GetComponent<MoveForward>(); mousePos = Input.mousePosition; muzzlePos = Camera.main.WorldToScreenPoint(muzzleTrans.position); shootDir = (mousePos - muzzlePos).normalized; bulletMoveForward.SetMoveDir(shootDir); } }