Пример #1
0
 private void ReleaseGrenadeEvent()
 {
     if (isLocalPlayer && grenade != null)
     {
         grenade.Release();
         grenade = null;
     }
 }
Пример #2
0
        public void TargetFinishGrenadeThrow(NetworkConnection connection, NetworkIdentity grenade)
        {
            Grenade newGrenade = grenade.GetComponent <Grenade>();

            newGrenade.Throw(networkIdentity, grenadeThrowingForce + GetComponentInChildren <PlayerMover>().Speed);
            soldierAnimatorUpdater.ThrowGrenade(newGrenade);
            inventory.RemoveThrownGrenade();
            currentGrenade   = null;
            isHoldingGrenade = false;
        }
Пример #3
0
        private void OnSwitchThirdWeapon()
        {
            ObjectContainedInventory grenade = inventory.GetGrenade();

            currentGrenade = grenade == null ? null : grenade.GetItem() as Grenade;
            if (currentGrenade != null)
            {
                isHoldingGrenade = true;
            }
        }
Пример #4
0
 private void RpcThrowGrenade(NetworkIdentity grenade)
 {
     if (grenade != null && isThrowingGrenade == false)
     {
         animator.SetLayerWeight(layerIndexGrenadeThrow, 1);
         animator.SetLayerWeight(layerIndexHands, 0);
         animator.Play(AnimationNameThrowGrenade, -1, 0f);
         isThrowingGrenade = true;
         this.grenade      = grenade.gameObject.GetComponent <Grenade>();
     }
 }
Пример #5
0
 public void ThrowGrenade(Grenade grenade)
 {
     CmdThrowGrenade(grenade.gameObject.GetComponent <NetworkIdentity>());
 }