IEnumerator modeHelper(int newMode) { transformSound.Play(); anim.SetTrigger("Transform"); isAttacking = true; changingmodes = true; yield return(new WaitForSeconds(2f)); for (int i = 0; i < 50; i++) { GameObject g = Instantiate(vapeNache, transform.position, Random.rotation); g.GetComponent <Rigidbody>().velocity = Random.onUnitSphere * 3; Destroy(g, 1f); } currentAttack = attacks[newMode]; currentMode.SetActive(false); currentMode = modes[newMode]; currentMode.SetActive(true); anim = currentMode.GetComponent <Animator>(); isAttacking = false; changingmodes = false; transformSound.Stop(); }
////////////////////////////////////////////////////////////////////////////// // MAIN METHODS // ////////////////////////////////////////////////////////////////////////////// void Start() { switch (playerNumber) { case 1: inputFunc = leftStick; break; case 2: inputFunc = rightStick; break; case 3: inputFunc = leftStick2; break; case 4: inputFunc = rightStick2; break; } currentMode = modes[0]; anim = currentMode.GetComponent <Animator>(); attacks = new attackDelegate[3]; attacks[0] = basicAttack; attacks[1] = tankAttac; attacks[2] = swardAttac; currentAttack = attacks[0]; rb = GetComponent <Rigidbody>(); currentHealth = maxHealth; }
IEnumerator DoDynamicRam() { //Startup isAttacking = true; animator.SetTrigger("DYNAMIC_RAM"); yield return(new WaitForSeconds(15 * (1f / 60f))); attackMovementDelegate += MoveForward; Debug.Log("Ram2"); yield return(new WaitForSeconds((comboJSON.getStartup("DYNAMIC_RAM") - 15) * (1f / 60f))); //Active GameObject hitbox = HitboxPooler.Instance.SpawnFromPool("DYNAMIC_RAM", comboJSON.getPosition("DYNAMIC_RAM")); hitbox.GetComponent <PlayerHitboxController>().setDamage(comboJSON.getDamage("DYNAMIC_RAM")); yield return(new WaitForSeconds(comboJSON.getActive("DYNAMIC_RAM") * (1f / 60f))); //Endlag hitbox.SetActive(false); yield return(new WaitForSeconds(comboJSON.getEndlag("DYNAMIC_RAM") * (1f / 60f))); EndAttack(); }
private void resetBase() { currentAttack = attacks[0]; currentMode.SetActive(false); currentMode = modes[0]; currentMode.SetActive(true); anim = currentMode.GetComponent <Animator>(); }
private void EndAttack() { isAttacking = false; canMoveWhileAttacking = false; attackMovementDelegate = null; timeOfLastAttack = Time.time; AttackQueueManager(); }
/** * * @brief * metoda odpowiedzialna za wykonanie ataku, * losuje wykonanie odpowiedniej akcji */ protected virtual IEnumerator Attack() { switch (Random.Range(0, 100)) { case int n when(n > alternativeAttackChance): attacking = StandardAttack; break; default: attacking = AlternativeAttack; break; } yield return(new WaitForSeconds(0.1F)); }
IEnumerator DoBombDash() { float runningTime = 40f; isAttacking = true; animator.SetTrigger("BOMB_DASH"); IgnoreEnemyCollision(true); for (int i = 0; i < 3; i++) { attackMovementDelegate += MoveForward; yield return(new WaitForSeconds(runningTime * (1f / 60f))); attackMovementDelegate = null; velocity.y = 5f; yield return(new WaitForSeconds(runningTime * (1f / 60f))); // drop bomb GameObject bombPrefab = ObjectPooler.Instance.SpawnFromPool(Pool.BOMB, transform.position, Quaternion.identity); BombDashController bomb = bombPrefab.GetComponent <BombDashController>(); } IgnoreEnemyCollision(false); EndAttack(); }
public AttackAct(attackDelegate _attackDel, int _enactTime, int _amount = 1) { attackDel = _attackDel; enactTime = --_enactTime; amount = _amount; }