public void CharacterDies() { // totalDuration = deathAnimTimings[deathAnimTimings.Length-1]; // totalTicks = deathAnimTimings.Length-1; // tick = 0; // timer = 0f; // Stop all scripts that need to be stopped. // Turn off hit collider. hitCol.enabled = false; // Stop weapon motion. charAtk.StopPreviousMotion(); // Turn off attack script. charAtk.enabled = false; // Turn off movement script. charMov.enabled = false; // Turn weapon off. weaponSpriteR.sprite = null; // Turn weapon swapping script off. charWeaps.enabled = false; // Turn shadow off. shadow.SetActive(false); // Stop checking for character flip. // Turn off mouse pointer? charMov.mySpriteAnim.Play(ClipDeath); deathSequence.StartCoroutine(deathSequence.DeathUI()); Time.timeScale = 0.33f; //StartCoroutine(DeathAnimation()); }
public void SpecialAttack() { charAtk.ReadyToAttack(false); mainSpecialSO = charAtk.weapon; SO_WindupFX[0] = mainSpecialSO.specialAttack.sO_AttackFXWindup[0]; SO_HoldFX[0] = mainSpecialSO.specialAttack.sO_AttackFXHold[0]; //print(mainSpecialSO.specialAttack.sO_AttackFXRelease.Length); SO_ReleaseFX.Clear(); for (int i = 0; i < mainSpecialSO.specialAttack.sO_AttackFXRelease.Length; i++) { //print("HELLO"); if (i >= SO_ReleaseFX.Count) { SO_ReleaseFX.Add(mainSpecialSO.specialAttack.sO_AttackFXRelease[i]); } else { SO_ReleaseFX[i] = mainSpecialSO.specialAttack.sO_AttackFXRelease[i]; } } SO_WindupCharMo = mainSpecialSO.specialAttack.sO_CharAtk_Motion; sOWeapoMo = mainSpecialSO.specialAttack.sO_Weapon_Motion; // Perform the special attack. // If the attack is triggered, make sure that the grace period is set back to false since it is used. moIn.attackButtonActions.attackButtonTapInGrace = false; // Disallow weapon swapping. charAtk.equippedWeapons.canSwapWeapon = false; // Stop the previous motion if needed. charAtk.StopPreviousMotion(); // Set the weapon back to its resting position and rotation. Usually the first attack chain's resting values. charAtk.ResetWeaponLocalValues(); // Allow character flip and the weapon to "look at" the mouse. charAtk.ForceCharFlipAndWeaponLookAt(); weaponMotion = charAtk.weaponMotionController.CheckMotionList(sOWeapoMo.weapon_Motion); //windupFX = null; //holdFX = null; //releaseFX = null; releaseFX.Clear(); windupFX[0] = charAtk.atkFXPool.RequestAttackFX(); windupFX[0].inUse = true; holdFX[0] = charAtk.atkFXPool.RequestAttackFX(); holdFX[0].inUse = true; for (int i = 0; i < SO_ReleaseFX.Count; i++) { if (i >= releaseFX.Count) { releaseFX.Add(charAtk.atkFXPool.RequestAttackFX()); } else { releaseFX[i] = charAtk.atkFXPool.RequestAttackFX(); } releaseFX[i].inUse = true; } if (specialAtkCoroutine != null) { specialAtkCoroutine = null; } specialAtkCoroutine = StartCoroutine(InSpecialAttack()); }