public void OnTriggerEnter2D(Collider2D collision) { //Debug.Log("TODO: GO TO NEXT DUNGEON!"); SimplePlayer p = collision.gameObject.GetComponent <SimplePlayer>(); //Debug.Log(p.health); GameStores.SetHealth(p.health); GameStores.SetDefMod(p.shieldModifier); GameStores.SetAtkMod(p.fireDelay); //Debug.Log(p.shieldModifier); GameStores.IncrementLength(); GameStores.IncrementDepth(); if (GameStores.GetDepth() == firstBoss) { SceneManager.LoadScene("BossWall"); } else if (GameStores.GetDepth() == secondBoss) { SceneManager.LoadScene("BossHux"); } else { SceneManager.LoadScene("Dungeon"); } }
// Start is called before the first frame update void Start() { source = GetComponent <AudioSource>(); switch (GameStores.GetDepth()) { case 1: source.clip = clips[0]; break; case 2: source.clip = clips[1]; break; case 3: source.clip = clips[2]; break; case 4: source.clip = clips[3]; break; case 5: source.clip = clips[4]; break; case 6: source.clip = clips[5]; break; default: source.clip = clips[5]; break; } source.Play(); }
// Start is called before the first frame update void Start() { title = titleText.gameObject; sub = subText.gameObject; int depth = GameStores.GetDepth(); titleText.text = "Level " + depth.ToString(); if (depth < midBoss) { subText.text = "Midboss in " + (midBoss - depth).ToString() + (midBoss - depth == 1 ? " Stage" : " Stages"); } else { subText.text = "Boss in " + (bigBoss - depth).ToString() + (bigBoss - depth == 1 ? " Stage" : " Stages"); } states = new Dictionary <State, System.Action>(); states.Add(State.MoveIn, MoveIn); states.Add(State.Stay, PosStay); states.Add(State.MoveOut, MoveOut); states.Add(State.Done, () => { Destroy(gameObject); }); }