public override void Enter() { base.Enter(); process = 1; if (_weaponAttribute.active) { _animator.animator.SetTrigger("pickWeapon"); _animator.animator.SetInteger("weaponTarget", (int)_weaponAttribute.type); _animator.AddEvent("weaponType", (int)_weaponAttribute.type); _iKManager.SetHoldTarget(_weaponAttribute.holdPoint); _iKManager.SetAim(false); _iKManager.SetHold(false); _iKManager.SetLook(true); endTimer.Enter(endTime); pickTimer.Enter(pickTime); _weaponHandle.locked = true; var cutMsg = new UiEvent.UiMsgs.WeaponCut() { texture = _weaponAttribute.cutPicInBattle }; _uiMgr.SendEvent(cutMsg); var ammoMsg = new UiEvent.UiMsgs.Ammo() { ammo = _weaponAttribute.runtimeMag + (_weaponAttribute.bore ? 1f : 0f), mag = _weaponAttribute.mag }; _uiMgr.SendEvent(ammoMsg); var spreadMsg = new UiEvent.UiMsgs.Spread() { value = _weaponAttribute.spread }; _uiMgr.SendEvent(spreadMsg); } else { _weaponAttribute.constraint.weight = 1; foreach (var state in _weaponAttribute.states.Values) { if (!state._name.Equals(this._name)) { if (state._active) { state.Exit(); } } } _weaponAttribute.ready = false; this._exitTick = true; } _iKManager.SetAim(false); _iKManager.SetHold(false); }
void SendSpreadMsg(float v) { var spreadMsg = new UiEvent.UiMsgs.Spread() { value = v }; _uiMgr.SendEvent(spreadMsg); }
public override void Exit() { base.Exit(); _camera.FOVtarget = _camera.FOVdefault; _velocity.aiming = false; var spreadMsg = new UiEvent.UiMsgs.Spread() { value = _weaponAttribute.spread * (_velocity.crouch ? _weaponAttribute.crouchSpreadRate : 1f) + 10f }; _uiMgr.SendEvent(spreadMsg); }
public override void Enter() { base.Enter(); if (!_weaponAttribute.reload) { _iKManager.SetAim(true); } _velocity.Drun = false; _velocity.aiming = true; _camera.FOVtarget = FOV; var spreadMsg = new UiEvent.UiMsgs.Spread() { value = _weaponAttribute.runingSpread + 5f }; _uiMgr.SendEvent(spreadMsg); }