//launch player hit effect public void OnDamage() { playerHit.launchParticle(); //SFX player hit MusicManager.Instance.PlayPlayerHit(); }
//launch player hit effect public void OnDamage() { playerHit.launchParticle(); //SFX player hit MusicManager.Instance.PlayPlayerHit(); CameraShaker.Instance.ShakeOnce(4f, 4f, 0.1f, 1f); }
/** * Launch player move if player can move */ private void LaunchMoveMechanic() { isMoving = true; //FX wheels particule moveParticle.launchParticle(); //The next tile position is Vector3Int nextPos = new Vector3Int(playerPath[tileIndex].X, 0, playerPath[tileIndex].Y); if (Mathf.Abs(transform.position.x - nextPos.x) < 0.001f && Mathf.Abs(transform.position.z - nextPos.z) < 0.001f) { //si on arrive à la tile finale où le player peut se rendre if (tileIndex == playerPath.Count - 1) { this.transform.position = new Vector3(nextPos.x, this.transform.position.y, nextPos.z); playerCanMove = false; isMoving = false; tileIndex = 0; //FX wheels particule moveParticle.stopParticle(); StartCoroutine(LaunchActionsInNewNode()); //Attends avant de permettre un autre move (pour ralentir le rythme) } else if (tileIndex < playerPath.Count - 1) { tileIndex++; //on passe à la tile suivante tant qu'on a pas atteint la dernière } } else { float ratio = (float)tileIndex / (playerPath.Count - 1); //Ratio between 0 and 1, 0 for the closest and 1 for the final one ratio = playerMoveCurve.Evaluate(ratio); //Linked to the curve to modify it as we want float speed = playerSpeed * ratio; //Link ratio to modify speed transform.position = Vector3.MoveTowards(transform.position, new Vector3(nextPos.x, this.transform.position.y, nextPos.z), speed * Time.deltaTime); //Go to next tile } }
/** * Coroutine pour timer l'effet damage du player sur l'animes d'attaque de l'enemy (fix au scotch) */ public IEnumerator AttackFromEnemyParticleCoroutine(bool hasClaw) { yield return(new WaitForSeconds(timeBeforeImpact)); if (hasClaw) { Debug.Log("launch Claw !"); clawAttackParticle.launchParticle(); } else { //Debug.Log("launch Slash !"); //slashAttackParticle.launchParticle(); } }
public void LaunchCursedNodeTrigger() { triggerCursed.launchParticle(); }
public void LaunchHealNodeTrigger() { triggerHeal.launchParticle(); }
public void LaunchChestNodeTrigger() { triggerChest.launchParticle(); }
public void OnPlayerFastShoes() { playerFastShoes.launchParticle(); }
public void OnPlayerCounter() { playerCounter.launchParticle(); }
public void OnKillerInstinct() { playerKillerInstinct.launchParticle(); }
//launch player PowerUp effect public void OnPowerUp() { playerPowerUp.launchParticle(); }
//launch player Shield effect public void OnShield() { playerShield.launchParticle(); }
/** * Launch hit visual effect on enemy */ public void OnDamage() { enemyHit.launchParticle(); //Lance la particule de hit //SFX enemy hit MusicManager.Instance.PlayEnemyHit(); }