private void StartWeaponCombo() { if (Weapons.Length > 0 && _currentWeaponIndex < weaponRhythmData.Length) { //The total time to wait for the combo input DropComboDelay = weaponRhythmData[_currentWeaponIndex].DropComboWindow + weaponRhythmData[_currentWeaponIndex].ExecutionWindow; ExecutionWindowTime = DropComboDelay - weaponRhythmData[_currentWeaponIndex].ExecutionWindow; if (_currentWeaponIndex == 0) { RhythmicComboEvent.Trigger(DropComboDelay, ExecutionWindowTime, ComboStatuses.Start); } if (TimeSinceLastWeaponStopped <= ExecutionWindowTime) { _currentWeaponIndex = 0; } TimeSinceLastWeaponStopped = 0f; _countdownActive = true; StartIndicator(); } else { //This was the last Weapon in the combo _countdownActive = false; _currentWeaponIndex = 0; } }
public override void WeaponStarted(Weapon weaponThatStarted) { //We are in the middle of a Combo if (_countdownActive && _currentWeaponIndex > 0) { RhythmicComboEvent.Trigger(DropComboDelay, ExecutionWindowTime, ComboStatuses.Success); } //Debug.Log("SUCCESS >> Time since last Weapon Stopped:"+TimeSinceLastWeaponStopped); else { RhythmicComboEvent.Trigger(DropComboDelay, ExecutionWindowTime, ComboStatuses.Fail); } //Debug.Log("FAIL >> Time since last Weapon Stopped:"+TimeSinceLastWeaponStopped); StopIndicator(); base.WeaponStarted(weaponThatStarted); //_countdownActive = false ProcessComboByState(StartComboState.WeaponStart); }
protected override void ResetCombo() { if (Weapons.Length > 1) { if (_countdownActive && DroppableCombo) { TimeSinceLastWeaponStopped += Time.deltaTime; if (TimeSinceLastWeaponStopped > DropComboDelay) { _countdownActive = false; _currentWeaponIndex = 0; OwnerCharacterHandleWeapon.CurrentWeapon = Weapons[_currentWeaponIndex]; OwnerCharacterHandleWeapon.ChangeWeapon(Weapons[_currentWeaponIndex], Weapons[_currentWeaponIndex].WeaponID, true); RhythmicComboEvent.Trigger(DropComboDelay, ExecutionWindowTime, ComboStatuses.TimedOut); StopIndicator(); } } } }