public void Play(Action callBack) { _isPlaying = true; _actCallback = callBack; _playOnesTorpedo(); _setState(StateType.TorpedoMove); BattleTaskManager.GetBattleShips().SetTorpedoSalvoWakeAngle(isSet: false); _straightController.ReferenceCameraTransform = _fieldCam.transform; _straightController.BeginPivot = _vecStraightBegin; _straightController.TargetPivot = _vecStraightTarget; _straightController._params.gazeHeight = _fStraightTargetGazeHeight; _straightController.FlyingFinish2F.Take(1).Subscribe(delegate { _straightController._isAnimating = false; _setState(StateType.End); }); _straightController.PlayAnimation().Subscribe(delegate { }).AddTo(_straightController.gameObject); }
public bool Run() { if (_isPlaying) { if (_stateType == StateType.TorpedoShot) { _fPhaseTime += Time.deltaTime; if (_fPhaseTime > 2f) { _centerLine.alpha = 0f; _startZoomTorpedo(); _setState(StateType.TorpedoMove); BattleTaskManager.GetBattleShips().SetTorpedoSalvoWakeAngle(isSet: false); _straightController.ReferenceCameraTransform = _fieldCam.transform; _straightController.BeginPivot = _straightBegin; _straightController.TargetPivot = _straightTarget; _straightController._params.gazeHeight = _straightTargetGazeY; _straightController.FlyingFinish2F.Take(1).Subscribe(delegate { _straightController._isAnimating = false; _setState(StateType.End); }); _straightController.PlayAnimation().Subscribe(delegate { }).AddTo(_straightController.gameObject); } } else if (_stateType == StateType.End) { _onTorpedoAttackFinished(); _stateType = StateType.None; return(true); } } return(false); }