示例#1
0
        private void Update()
        {
            if (_gun == null)
            {
                throw new System.Exception("Gun null exception");
            }

            _gun.SetShootDirection(Vector3.forward);

            //_gun.Shoot();

#if UNITY_EDITOR
            if (Input.GetKeyDown(KeyCode.Space))
            {
                if (_gun.IsShooting == false)
                {
                    _gun.StartShoot();
                }
            }

            if (Input.GetKeyUp(KeyCode.Space))
            {
                if (_gun.IsShooting)
                {
                    _gun.StopShoot();
                }
            }
#endif
        }