public void HandOnBomb() { if (_mirroredAnimDoubleHandOnCall_IsCalled) { return; } _mirroredAnimDoubleHandOnCall_IsCalled = true; GameObject newExp = null; if (!UseMirrorThrow) { newExp = Instantiate(player.throwableBag[CurrentThrowableIndex].throwablePrefab.gameObject, leftHandHold.position, leftHandHold.rotation) as GameObject; newExp.transform.SetParent(leftHandHold); } else { newExp = Instantiate(player.throwableBag[CurrentThrowableIndex].throwablePrefab.gameObject, rightHandHold2.position, rightHandHold2.rotation) as GameObject; newExp.transform.SetParent(rightHandHold2); } if (newExp.GetComponent <Rigidbody>()) { newExp.GetComponent <Rigidbody>().isKinematic = true; } if (newExp.GetComponent <Collider>()) { newExp.GetComponent <Collider>().enabled = false; } cExploderClone = newExp.GetComponent <Exploder>(); if (cExploderClone.GetComponent <LineRenderer>()) { cExploderClone.GetComponent <LineRenderer>().enabled = true; } Events.InvokeOnPullOut(cExploderClone); cExploderClone.PlayRandomSoundAsWeaponChild(cExploderPrefab.sounds.pins, transform, true); }
public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { if (stateInfo.shortNameHash == h_Empty) { _mirroredAnimDoubleHandOnCall_IsCalled = false; player.SmbWeapon.LeftHandEnabled = true; UpperBodyLayerTarget = 0; ReleaseTriggers(); } else if (stateInfo.shortNameHash == h_PullOut) { SetThrowable(nextThrowableIndex); if (cExploderPrefab.leftHandHoldPositionRotation && !UseMirrorThrow) { leftHandHold.localRotation = cExploderPrefab.leftHandHoldPositionRotation.localRotation; leftHandHold.localPosition = cExploderPrefab.leftHandHoldPositionRotation.localPosition; } else if (cExploderPrefab.rightHandHoldPositionRotation && UseMirrorThrow) { rightHandHold2.localRotation = cExploderPrefab.rightHandHoldPositionRotation.localRotation; rightHandHold2.localPosition = cExploderPrefab.rightHandHoldPositionRotation.localPosition; } if (cExploderPrefab) { cExploderPrefab.PlayRandomSoundAsWeaponChild(cExploderPrefab.sounds.pulls, transform, true, transform); } } else if (stateInfo.shortNameHash == h_ToReady) { animator.SetInteger(cap_Throw, 1); } else if (stateInfo.shortNameHash == h_ReadyIdle) { throwDir = Quaternion.AngleAxis(-cExploderClone.additionalThrowAngleHorizontal, playerCamera.transform.right) * playerCamera.transform.forward; if (IndicatorTrigger() /*|| 1 == 1*/) { if (!playerCamera.IsOverridenWithKey(c_overrideKey)) { if (!player.SmbCover.IsInCover) { playerCamera.OverrideCamera(CThrowProps.cameraProps, 1, c_overrideKey); } else if (playerCamera.IsOverridenWithKey(c_overrideKey)) { playerCamera.ChangePointerOfCamModderWithID(CThrowProps.cameraProps, c_overrideKey); } } } } else if (stateInfo.shortNameHash == h_Throw) { if (cExploderClone) { cExploderClone.PlayRandomSoundAsWeaponChild(cExploderPrefab.sounds.throws, transform, transform); } } }