void OnTriggerEnter2D(Collider2D other) { if (other.tag == Tags.playerBox) { BoxEnemyChoice weaponEnemyChoice = other.gameObject.GetComponent <BoxEnemyChoice>(); //string result = RockPaperScissors.WeaponResult(weaponCollision.weaponType, enemyType); if (weaponEnemyChoice.weaponType == enemyType) { gameControllerScoreScript.addScore(enemyPoints, enemyIndex); //animator.SetBool(animatorHash.dead, true); weaponEnemyChoice.KilledEnemy(); if (transform.localScale == vectorUnScaled) { if (!AudioManager.getIsPlaying(deathAudio.ToString())) { AudioManager.PlaySound(deathAudio.ToString(), Vector3.zero); } } if (useSparkles) { sparklesPooler.UsePooledObject(transform.position, Quaternion.identity); } gameObject.SetActive(false); } else { //gameControllerScoreScript.subtractScore(0); ////Destroy(gameObject); AudioManager.PlaySound(AudioNames.PlayerDraw.ToString(), Vector3.zero); gameObject.SetActive(false); } enemyCollider2d.enabled = false; } }
public static string GetFileName(AudioNames audioname) { int num = (int) audioname + 1; if (num >= 6) num++; return string.Format("{0:00}-", num) + audioname.ToString(); }
public override void ExecuteEvents() { AudioManager.PlaySound(audio.ToString(), Vector3.zero); }
public void PlayTheAudio() { AudioManager.PlaySound(audioToPlay.ToString(), transform.position); }
public void MakeSoundCopy() { audioCopiedObject = AudioManager.CopySound(audioToCopy.ToString(), transform); audioSourceCopied = audioCopiedObject.GetComponent <AudioSource>(); }