private IEnumerator FiringSequence() { SetEmitterChargePathsStatus(true); m_WeaponCharging = true; m_ArrayPathForwardTween.DORewind(); m_ArrayPathReverseTween.DORewind(); float arrayPathForwardTweenDuration = Mathf.Abs(Mathf.Abs(m_AngleOfAttack.y) - Mathf.Abs(m_AngleToTarget)) / m_ArrayChargeTime; float arrayPathReverseTweenDuration = Mathf.Abs(Mathf.Abs(m_AngleOfAttack.x) - Mathf.Abs(m_AngleToTarget)) / m_ArrayChargeTime; m_ArrayPathForwardTween.GetTween().timeScale = arrayPathForwardTweenDuration; m_ArrayPathReverseTween.GetTween().timeScale = arrayPathReverseTweenDuration; m_ArrayPathForwardTween.DOPlay(); m_ArrayPathReverseTween.DOPlay(); while (!m_EmitterCollision) { yield return(null); } m_WeaponCharging = false; if (m_Target != null) { SetEmitterChargePathsStatus(false); m_EmitterCollision = false; m_WeaponDischarging = true; m_BeamClone.Fire(m_Target.transform.position, true); } }
protected override void CustomPlayFeedback(Vector3 position, float feedbacksIntensity = 1.0f) { switch (Mode) { case Modes.DOPlay: TargetDOTweenPath.DOPlay(); break; case Modes.DOPlayBackwards: TargetDOTweenPath.DOPlayBackwards(); break; case Modes.DOPlayForward: TargetDOTweenPath.DOPlayForward(); break; case Modes.DOPause: TargetDOTweenPath.DOPause(); break; case Modes.DOTogglePause: TargetDOTweenPath.DOTogglePause(); break; case Modes.DORewind: TargetDOTweenPath.DORewind(); break; case Modes.DORestart: TargetDOTweenPath.DORestart(); break; case Modes.DOComplete: TargetDOTweenPath.DOComplete(); break; case Modes.DOKill: TargetDOTweenPath.DOKill(); break; } }