public void StartLevel() { // audio if (currentArea == "Jungle") { AudioManager.PlayMusic("music_jungle"); } else if (currentArea == "Dungeon") { AudioManager.PlayMusic("music_dungeon"); } else if (currentArea == "Temple" || currentArea == "Temple Boss") { AudioManager.PlayMusic("music_temple"); } // dungeon stuff dungeonGen.CreateDungeon(); if (fog != null) { fog.Init(); } EnemyManager.InitializeEnemyDrops(); TempleCurseSystem.Reset(); //fade shows the title, pauses time as well StartCoroutine(ShowingLevelTitle()); //player.transform.position; Player.playerMovement.SetSnakeSpawn(startObject.transform.position, startDirection); startObject.GetComponent <TeleporterTile>().SetTeleporterAnimation(false, 2); Player.playerEffects.SetPlayerEntering(); }
private void Awake() { instance = this; isEnabled = true; curseTicks = 0; TimeTickSystem.OnTick_Dungeon += TimeTickSystem_OnTick; }
public virtual void Die() { if (animator != null && animator.animator != null) { animator.animator.SetBool("isDead", true); } if (myName != "") { AudioManager.Play(myName + "_die"); } foreach (GameObject e in effects) { Destroy(e); } if (itemDrop != null) { Instantiate(itemDrop, transform.position, Quaternion.identity, transform.parent); } if (TempleCurseSystem.isEnabled && reducesCurseOnKill) { TempleCurseSystem.GetKill(); } if (deathParticle != null && lastHitDir != Vector3.zero) { double angle = Mathf.Atan2(lastHitDir.y, lastHitDir.x) * Mathf.Rad2Deg; Quaternion rot = Quaternion.Euler(0, 0, (float)angle); GameObject particle = Instantiate(deathParticle, transform.position, rot, transform.parent); if (animator != null) { ParticleSystem.MainModule settings = particle.GetComponent <ParticleSystem>().main; settings.startColor = new ParticleSystem.MinMaxGradient(animator.deathParticlesColor); } } EnemyManager.RemoveEnemy(gameObject); }