Esempio n. 1
0
        private void CheckShooting()
        {
            shootingCooldown.CoolDownUpdate();

            if (Input.GetMouseButton(0) && !shootingCooldown.IsOnCoolDown())
            {
                shootingCooldown.StartCoolDown();

                //Define Bullet
                bulletData.position.x  = bulletSpawnPoint.position.x.TwoDecimals();
                bulletData.position.y  = bulletSpawnPoint.position.y.TwoDecimals();
                bulletData.direction.x = bulletSpawnPoint.up.x;
                bulletData.direction.y = bulletSpawnPoint.up.y;

                //Send Bullet
                networkIdentity.GetSocket().Emit("fireBullet", new JSONObject(JsonUtility.ToJson(bulletData)));
            }
        }