public void HomeBtn() { BgmController sound = GameObject.Find("GameMgr").GetComponent <BgmController>(); sound.ChangeBgm(); StartCoroutine(OutDelay()); }
IEnumerator GameStartDelay() { yield return(new WaitForSeconds(1.0f)); MSGWin.SetActive(false); BgmController sound = GameObject.Find("GameMgr").GetComponent <BgmController>(); sound.ChangeBgm(); loading.LoadScene("ItemCollectScene"); }
IEnumerator OutDelay() { GameObject.Destroy(player.transform.parent.gameObject); GameObject.Destroy(enemy.transform.parent.gameObject); GameObject.Destroy(GameObject.Find("itemBtnCanvas")); GameObject.Destroy(GameObject.Find("GameMgr2")); BgmController sound = GameObject.Find("GameMgr").GetComponent <BgmController>(); sound.ChangeBgm(); yield return(new WaitForSeconds(1.0f)); loading.LoadScene("WaitScene"); }
IEnumerator ItemDelay() { yield return(new WaitForSeconds(1.0f)); BgmController sound = GameObject.Find("GameMgr").GetComponent <BgmController>(); sound.ChangeBgm(); loading.LoadScene("GameScene"); while (true) { yield return(new WaitForSeconds(0.2f)); if (SceneManager.GetActiveScene().name == "GameScene") { Spawn(); break; } } }
// Update is called once per frame void Update() { checkPlayerRotation(); //方向をセット anim.SetInteger("dir", dir); anim.SetBool("reload", isReload); Skill skill = FindObjectOfType <Skill>(); //BGM操作 if (skill.kingSkill) { BgmController.ChangeBgm(1); } else { BgmController.ChangeBgm(0); } if (skill.ready) { if (Time.time > nextTime) { GetComponent <Renderer>().enabled = !GetComponent <Renderer>().enabled; nextTime += interval; } } if (!skill.ready) { GetComponent <Renderer>().enabled = true; } if (!GameManager.kingNotEffect) { if (!isReload) { //moveKeyboard(); //if (wark_velocity > 0) //{ //移動中のみタイマー作動 // sound_span -= Time.deltaTime; //タイマーのカウントダウン // if (sound_span <= 0) // { // walkSe.PlayOneShot(walkSe.clip); //足音を鳴らす // sound_span = 0.5f / (wark_velocity * 5f); //今の速度に合わせて次の音までの時間を決める // } //} moveTouch(); } else { if (!isCall) { Invoke("flgChange", 1f); } isCall = true; } push_tmp = false; if (Input.GetMouseButton(0) && !isReload) { //クリックして、オブジェクトがあったら GameObject obj = getClickObject(); push_tmp = true; if (obj != null) { if (obj.name == "TapZone") { PushDown(); } } } if (push_tmp) { chargeGauge(); } if (!push_tmp && push) { shootSe.PlayOneShot(shootSe.clip); PushUp(); } playerPos = transform.position; if (skill.kingSkill) { charge = 2f; } } }