private void ReleaseGrenadeEvent() { if (isLocalPlayer && grenade != null) { grenade.Release(); grenade = null; } }
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; }
private void OnSwitchThirdWeapon() { ObjectContainedInventory grenade = inventory.GetGrenade(); currentGrenade = grenade == null ? null : grenade.GetItem() as Grenade; if (currentGrenade != null) { isHoldingGrenade = true; } }
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>(); } }
public void ThrowGrenade(Grenade grenade) { CmdThrowGrenade(grenade.gameObject.GetComponent <NetworkIdentity>()); }