//离开房间 private void GetOut() { Takarabox.SetActive(true); //生成宝箱 Door.SetActive(false); //开门 CAudioController.PlayAudio("fx_door"); Destroy(this.gameObject); }
public void Die() { if (m_EnergyPoint) { GenerateEnergyPoint(transform.position); } CAudioController.PlayAudio("fx_broke"); Destroy(this.gameObject); }
private void OnTriggerEnter2D(Collider2D collision) { if (collision.CompareTag("Player")) { CAudioController.PlayAudio("fx_door"); Door.SetActive(true); //关门 ActivateEnemies(); } }
protected override void OnSceneLoaded(int index) { m_Index = index; StopAudio("bgm2"); StopAudio("bgm1"); switch (m_Index) { case 1: CAudioController.PlayAudio("bgm1"); break; case 2: CAudioController.PlayAudio("bgm2"); break; } }
protected virtual void Shoot() { if (this.gameObject.activeSelf) { b_ShootPressed = Input.GetMouseButton(0); if (t_Shoot > 0f) { t_Shoot -= _DELTATIME; } else if (b_ShootPressed && Player.GetComponent <CPlayer>().TellEnergy() >= COST) { t_Shoot = SHOOT_CD; Player.GetComponent <CPlayer>().CostEnergy(COST); CAudioController.PlayAudio(fx_Weapon); GenerateBullet(); if (Player.GetComponent <CPlayer>().TellSkillOn()) //如果使用了技能,射击两次(没写双倍蓝耗) { Invoke(nameof(GenerateBullet), 0.1f); } } } }
public void CloseHelp() { CAudioController.PlayAudio("fx_menu"); Time.timeScale = 1; Help.SetActive(false); }
public void OpenHelp() { CAudioController.PlayAudio("fx_menu"); Time.timeScale = 0; Help.SetActive(true); }
public void Continue() { CAudioController.PlayAudio("fx_menu"); Time.timeScale = 1; PauseMenu.SetActive(false); }
public void Pause() { CAudioController.PlayAudio("fx_menu"); Time.timeScale = 0; PauseMenu.SetActive(true); }