Exemple #1
0
        private void LocalShoot()
        {
            if (this.m_tank.TankType != TankType.Local)
            {
                return;
            }

            if (Time.time - this.lastShootTime < this.shootInterval)
            {
                return;
            }

            // this.m_tank.BeAttacked(30f);

            Vector3 pos = this.m_tank.Gun.transform.position + this.m_tank.Gun.transform.forward * 2;

            //
            Bullet bullet = BulletFactory.Create(this.m_tank);

            bullet.GameObject.transform.position = pos;

            bullet.GameObject.transform.rotation = this.m_tank.Gun.transform.rotation;

            //UnityEditor.EditorApplication.isPaused = true;


            //UnityEditor.EditorApplication.isPaused = true;

            Send_C2B_Shoot(pos, bullet.GameObject.transform.eulerAngles);

            this.lastShootTime = Time.time;
        }
Exemple #2
0
        private void RemoteShoot(Vector3 pos, Vector3 eulerAngles)
        {
            if (this.m_tank.TankType != TankType.Remote)
            {
                return;
            }

            Bullet bullet = BulletFactory.Create(this.m_tank);

            bullet.GameObject.transform.position = pos;

            bullet.GameObject.transform.eulerAngles = eulerAngles;
        }