Esempio n. 1
0
    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");
    }
Esempio n. 3
0
    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");
    }
Esempio n. 4
0
    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;
            }
        }
    }
Esempio n. 5
0
    // 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;
            }
        }
    }