private IEnumerator EnterVehicleAnimation(Vehicle.Seat seat, bool immediate) { var animIndex = seat.IsLeftHand ? AnimIndex.GetInLeft : AnimIndex.GetInRight; PlayerModel.VehicleParentOffset = Vector3.Scale(PlayerModel.GetAnim(AnimGroup.Car, animIndex).RootEnd, new Vector3(-1, -1, -1)); if (!immediate) { var animState = PlayerModel.PlayAnim(AnimGroup.Car, animIndex, PlayMode.StopAll); animState.wrapMode = WrapMode.Once; while (animState.enabled) { yield return(new WaitForEndOfFrame()); } } if (seat.IsDriver) { IsDrivingVehicle = true; PlayerModel.PlayAnim(AnimGroup.Car, AnimIndex.Sit, PlayMode.StopAll); } else { PlayerModel.PlayAnim(AnimGroup.Car, AnimIndex.SitPassenger, PlayMode.StopAll); } IsInVehicleSeat = true; }
private void UpdateAnims() { if (!this.shouldPlayAnims) { return; } if (IsInVehicle || m_weaponHolder.IsHoldingWeapon) { return; } if (IsRunning) { PlayerModel.PlayAnim(AnimGroup.WalkCycle, AnimIndex.Run, PlayMode.StopAll); } else if (IsWalking) { PlayerModel.PlayAnim(AnimGroup.WalkCycle, AnimIndex.Walk, PlayMode.StopAll); } else if (IsSprinting) { PlayerModel.PlayAnim(AnimGroup.MyWalkCycle, AnimIndex.sprint_civi); } else { // player is standing PlayerModel.PlayAnim(AnimGroup.WalkCycle, AnimIndex.Idle, PlayMode.StopAll); } }