Beispiel #1
0
    private void BombPlant()
    {
        RaycastHit hit;

        Physics.Raycast(transform.position, Vector3.down, out hit, Mathf.Infinity, groundMask);
        NetworkServer.Spawn(Instantiate(plantedBomb, hit.point + plantOffset, Quaternion.LookRotation(hit.normal)));
        weaponSelector.currentWeapon = weaponSelector.FindNextWeapon(-1, 1, true);
        weaponSelector.SelectWeapon(weaponSelector.currentWeapon);
        RoundSystem.PlantBomb();
        NetworkServer.Destroy(gameObject);
    }
Beispiel #2
0
    private void RpcDrop()
    {
        if (isClientOnly)
        {
            weaponSelector.weapons[weaponSelector.currentWeapon] = null;
        }
        if (!weaponSelector.hasAuthority)
        {
            return;
        }
        int curWeapon = weaponSelector.FindNextWeapon(-1, 1, true);

        weaponSelector.SelectWeapon(curWeapon);
        weaponSelector.currentWeapon = curWeapon;
    }
Beispiel #3
0
    private void CmdThrowGrenade()
    {
        if (throwing)
        {
            return;
        }
        throwing = true;
        GameObject grenade = Instantiate(thrownGrenade, throwingPoint.position, throwingPoint.rotation);

        NetworkServer.Spawn(grenade, netIdentity.connectionToClient);
        force = throwForce + playerMovement.moveData.velocity;
        grenade.GetComponent <GrenadeThrown>().GrenadeTimer(force, transform.root.gameObject);
        weaponSelector.currentWeapon = weaponSelector.FindNextWeapon(-1, 1, true);
        weaponSelector.SelectWeapon(weaponSelector.currentWeapon);
        NetworkServer.Destroy(gameObject);
    }