Example #1
0
 private void Start()
 {
     bgmManager = GameObject.Find("BgmManager").GetComponent <BgmManager>();
     stage      = GameObject.Find("StageManager").GetComponent <StageManager>();
     player     = GameObject.FindGameObjectWithTag("Player").GetComponent <Characters.PlayerCtrl>();
     manager    = stage.GetComponent <QuestManager>();
 }
Example #2
0
    IEnumerator Countdown()
    {
        while (fade.IsFade)
        {
            yield return(null);
        }
        aud.Play();
        for (int count = countDownImage.Length - 1; count >= 0; count--)
        {
            //表示
            countDownImage[count].SetActive(true);
            //1秒待つ
            float t = 0.0f;
            while (t <= 1.0f)
            {
                t += Time.unscaledDeltaTime;
                yield return(null);
            }
            //消す
            countDownImage[count].SetActive(false);
        }
        Time.timeScale = 1.0f;
        yield return(new WaitForSeconds(1.0f));

        BgmManager.GetInstance().Play(BgmEnum.Game, true, 0.3f);
    }
Example #3
0
 private void Update()
 {
     if (bgm == null)
     {
         bgm = GameObject.FindGameObjectWithTag("AudioManager").GetComponent <BgmManager>();
     }
 }
Example #4
0
 void Awake()
 {
     if (BgmManager.instance == null)
     {
         BgmManager.instance = this;
     }
 }
Example #5
0
    // -----
    // Use this for initialization
    void Start()
    {
#if UNITY_EDITOR
        if (isDebug)
        {
            respawnPos = debugRespawnPos[debugPosIndex];
        }
#endif
        GameObject NetworkManagerObj = GameObject.FindGameObjectWithTag("NetworkManager");
        networkManager = NetworkManagerObj.GetComponent <NetworkManager>();

        GameObject logManagerObj = GameObject.FindWithTag("LogManager");
        if (logManagerObj != null)
        {
            logManager = logManagerObj.GetComponent <LogManager>();
        }

        PlayData.gameMode = GameMode.Play;

        // BGM
        BgmManager.Play("Threat");

        // ゴールの扉制御
        SetOnceCall(() => PlayData.bossDied, () => {
            goalGate.SetActive(false);
            // BGMの変更
            BgmManager.Play("JumpAndShootMan");
        });

        PlayData.loadDB = new BoolNoticer(false);
        PlayData.loadDB.SetOnChange(true, _ => MakeDeadDBData());

        corpseManager = GameObject.FindWithTag("CorpseManager").GetComponent <CorpseManager>();
        corpseManager.LoadData();
    }
    private BgmManager GetBgmManager(string sceneName = "")
    {
        if (sceneName == "")
        {
            sceneName = SceneManager.GetActiveScene().name;
        }

        BgmManager sceneBgm = null;
        int        index    = 0;

        switch (sceneName)
        {
        case Common.CO.SCENE_TITLE:
            sceneBgm = titleBgmList[index];
            break;

        case Common.CO.SCENE_CUSTOM:
        case Common.CO.SCENE_STORE:
        case Common.CO.SCENE_RANKING:
            sceneBgm = customBgmList[index];
            break;

        case Common.CO.SCENE_BATTLE:
            //GameControllerで制御
            break;
        }
        return(sceneBgm);
    }
Example #7
0
 private void PlayerDoDead()
 {
     BgmManager.StopBgm();
     SoundManager.PlayAudio(SoundManager.dead);
     StartCoroutine(Dead(playerPos, true));
     Destroy(playerZero.gameObject);
 }
Example #8
0
 internal void Update()
 {
     if (this.updateBgm)
     {
         BgmPlayer.Update();
         BgmManager.Update();
     }
 }
Example #9
0
    /*private void Start()
     * {
     *  zero = GameObject.FindGameObjectWithTag("Player").GetComponent<PlayerZero>();
     *  audioSource = GetComponent<AudioSource>();
     * }*/

    private void OnEnable()
    {
        zero        = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerZero>();
        audioSource = GetComponent <AudioSource>();
        audioSource.Play();
        BgmManager.StopBgm();
        BgmManager.PlayBgm(BgmManager.stage1Bgm);
    }
 void Start()
 {
     nowBgmMgr = GetBgmManager();
     if (nowBgmMgr != null)
     {
         nowBgmMgr.Play();
     }
 }
Example #11
0
 private void OnDisable()
 {
     BgmManager.PlayBgm(BgmManager.bossBgm);
     GameController.instance.canControll = true;
     boss.canMove = true;
     bossHpBar.SetActive(true);
     HumanAileAudioManager.instance.PlayAudio(HumanAileAudioManager.bossBattleStartAudio);
 }
Example #12
0
 private void Start()
 {
     fade = Fade.instance;
     fade.StartFadeIn();
     aud = GetComponent <AudioSource>();
     BgmManager.GetInstance().Stop();
     StartCoroutine(Gacha());
 }
Example #13
0
 private void Awake()
 {
     bgmMgr = GameObject.FindObjectOfType<BgmManager>();
     gameMgr = GameObject.FindObjectOfType<GameManager>();
     skillName = GameObject.Find("SkillName").GetComponent<Image>();
     illust = GameObject.Find("BigIllust").GetComponent<Image>();
     illustStartPos = new Vector2(1000, illustPos.y);
     skillNameStartPos = new Vector2(-1000, skillNamePos.y);
 }
Example #14
0
    private void Awake()
    {
        bgmMgr = GameObject.FindObjectOfType<BgmManager>();
        gameMgr = GameObject.FindObjectOfType<GameManager>();
        pauseBtn = GameObject.Find("PauseButton").GetComponent<Button>();
        pauseUI = transform.FindChild("PauseUI").gameObject;

        pauseBtn.onClick.AddListener(PauseButtonDown);
    }
Example #15
0
            public void CloseSingleton()
            {
                ViewAsync.ResetSignal(null);
                ViewString <long> .SetProvider(null);

                BgmManager.Stop(true);
                BgmManager.Reset();
                BgmPlayer.Close();
            }
Example #16
0
 void Start()
 {
     soundEffects    = GameObject.FindGameObjectWithTag("AudioManager").GetComponent <SoundEffectsManager>();
     bgm             = GameObject.FindGameObjectWithTag("AudioManager").GetComponent <BgmManager>();
     currProjectiles = new GameObject[12];
     Arrow.SetActive(false);
     currState = sleep;
     anim.Play("golemboss_sleep");
     attackMode = "normal";
 }
Example #17
0
 void Start()
 {
     PointManager.Reset();
     Time.timeScale = 0.0f;
     BgmManager.GetInstance().Stop();
     aud  = GetComponent <AudioSource>();
     fade = Fade.instance;
     fade.StartFadeIn();
     StartCoroutine(Countdown());
 }
    private void Start()
    {
        fade = Fade.instance;
        fade.StartFadeIn();
        BgmManager.GetInstance().Play(BgmEnum.Select);
        viewportMin = Camera.main.ViewportToWorldPoint(Vector2.zero);
        viewportMax = Camera.main.ViewportToWorldPoint(Vector2.one);
        for (int i = 0; i < PlayerCount.MaxValue; ++i)
        {
            PlayerJoinManager.SetJoinInfo(i, false);
        }

        for (int i = 0; i < playerNum; ++i)
        {
            playerUI[i] = new PlayerUI();
            foreach (Transform child in playerUIList[i].transform)
            {
                if (child.name == "Cursor")
                {
                    playerUI[i].cursor = child.gameObject;
                }
                else if (child.name == "Capsule")
                {
                    playerUI[i].capusuleTransform = child.transform;
                }
                else if (child.name == "OK")
                {
                    playerUI[i].okObj        = child.gameObject;
                    playerUI[i].startOkScale = child.gameObject.transform.localScale;
                    child.gameObject.SetActive(false);
                }
            }
        }

        for (int i = 0; i < animalNum; ++i)
        {
            startAnimal[i] = animalArray[i].transform.localPosition;

            foreach (Transform child in animalArray[i].transform)
            {
                if (child.tag == "Animal")
                {
                    animalMoveObj[i]   = child;
                    animalAnimation[i] = child.gameObject.GetComponent <PlayerAnimationController>();
                }
                else
                {
                    message[i] = child.gameObject;
                    message[i].SetActive(false);
                }
            }
            PlayerType type = animalArray[i].GetComponent <CharaType>().type;
            animalIndex.Add(type, i);
        }
    }
Example #19
0
 private void OnTriggerEnter2D(Collider2D other)
 {
     if (other.CompareTag("Player") && other is CircleCollider2D && canUse)
     {
         BgmManager.StopBgm();
         canUse     = false;
         isInsiding = true;
         GameController.instance.canControll = false;
         anim.SetTrigger("open");
     }
 }
    public void PlayBattleBgm(int no = -1)
    {
        if (no < 0 || battleBgmList.Count <= no)
        {
            //ランダム
            no = Random.Range(0, battleBgmList.Count);
        }
        BgmManager bgmMgr = battleBgmList[no];

        Play(bgmMgr);
    }
Example #21
0
 // Use this for initialization
 void Start()
 {
     if (instance == null)
     {
         instance = this;
     }
     else if (instance != this)
     {
         Destroy(gameObject);
     }
 }
Example #22
0
    IEnumerator ResultStart()
    {
        while (fade.IsFade)
        {
            yield return(null);
        }
        //各順位ごとにプレイヤーの番号を格納
        List <int>[] counts = new List <int> [PlayerCount.MaxValue];
        for (int i = 0; i < PlayerCount.MaxValue; ++i)
        {
            counts[i] = new List <int>();
        }

        for (int i = 0; i < PlayerCount.MaxValue; ++i)
        {
            if (!PlayerJoinManager.IsJoin(i))
            {
                continue;
            }
            counts[PointManager.GetRank(i) - 1].Add(i);
        }

        yield return(new WaitForSeconds(0.5f));

        // くす玉を開く間隔
        const float intervalTime = 1.0f;
        int         index        = PlayerCount.MaxValue - 1;

        for (int i = PlayerCount.MaxValue - 1; i >= 0; --i)
        {
            for (int j = 0; j < counts[i].Count; ++j)
            {
                KusudamaAnimationPlay(counts[i][j]);
                if (i == 0)
                {
                    Instantiate(
                        kamifubukiPrefab,
                        playerPosArray[counts[i][j]].transform.position + new Vector3(0, 2, 0),
                        kamifubukiPrefab.transform.rotation);
                }
                --index;
            }
            if (counts[i].Count != 0)
            {
                aud.Play();
                yield return(new WaitForSeconds(intervalTime));
            }
        }

        yield return(new WaitForSeconds(1.0f));

        BgmManager.GetInstance().Play(BgmEnum.Result, false);
        animEnd = true;
    }
Example #23
0
 void Start()
 {
     fade = Fade.instance;
     fade.StartFadeIn();
     aud = GetComponent <AudioSource>();
     PointManager.ApplyRank();
     kusudamaArray = new GameObject[PlayerCount.MaxValue];
     rankTextArray = new Image[PlayerCount.MaxValue];
     Generate();
     BgmManager.GetInstance().Stop();
     StartCoroutine(ResultStart());
 }
Example #24
0
 void Update()
 {
     if (soundEffects == null)
     {
         soundEffects = GameObject.FindGameObjectWithTag("AudioManager").GetComponent <SoundEffectsManager>();
     }
     if (bgm == null)
     {
         bgm = GameObject.FindGameObjectWithTag("AudioManager").GetComponent <BgmManager>();
     }
     currState.UpdateState();
 }
Example #25
0
    public void RockmanAileDoDead(Vector3 pos)
    {
        BgmManager.StopBgm();
        SoundManager.PlayAudio(SoundManager.dead);
        GameObject boss = GameObject.FindGameObjectWithTag("Boss");

        if (boss != null)
        {
            StartCoroutine(Dead(pos, false));
            Destroy(boss);
        }
    }
    //##### BGM #####

    //購入可能BGMリスト表示
    private void DispStoreMusicList()
    {
        DispListClear();
        MusicGetList.gameObject.SetActive(true);

        Transform storeMusicContent = MusicGetList.FindChild("View/Content");

        ////再生中BGM名
        //string playingBgmName = "";
        //if (PlayingText != null) playingBgmName = PlayingText.text;

        //リストクリア
        foreach (Transform child in storeMusicContent)
        {
            Destroy(child.gameObject);
        }

        //音楽リスト
        List <BgmManager> battleBgmList = SoundManager.Instance.GetBattleBgmList();

        for (int i = 0; i < battleBgmList.Count; i++)
        {
            int        musicIndex = i;
            BgmManager battleBgm  = battleBgmList[musicIndex];

            //OPENチェック
            bool isOpen = false;
            if (UserManager.userOpenMusics.IndexOf(musicIndex) >= 0)
            {
                isOpen = true;
            }

            GameObject row       = (GameObject)Instantiate(storeMusicObj);
            Transform  rowTran   = row.transform;
            string     musicName = battleBgm.GetAudioClipName();
            Text       musicText = rowTran.FindChild("Name").GetComponent <Text>();
            musicText.text = musicName;
            BgmManager bgmMgr = battleBgm;
            if (isOpen)
            {
                //再生
                musicText.color = (PlayingMusicIndex == musicIndex) ? playFontColor : normalFontColor;
                rowTran.GetComponent <Button>().onClick.AddListener(() => PlayMusic(musicIndex, bgmMgr));
            }
            else
            {
                //購入
                musicText.color = closeFontColor;
                rowTran.GetComponent <Button>().onClick.AddListener(() => BuyMusic(musicIndex, battleBgm));
            }
            rowTran.SetParent(storeMusicContent, false);
        }
    }
Example #27
0
            private void Start()
            {
                bgmManager = GameObject.Find("BgmManager").GetComponent <BgmManager>();
                player     = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerCtrl>();
                manager    = GameObject.Find("StageManager").GetComponent <QuestManager>();
                MainCamAct();

                if (questEnemy)
                {
                    questEnemy.enabled = false;
                }
                eventObj.SetActive(false);
            }
Example #28
0
    IEnumerator Gacha()
    {
        while (fade.IsFade)
        {
            yield return(null);
        }
        gachaAnimator.SetTrigger("TurnTrigger");
        aud.PlayOneShot(gachaRotateAudio);
        yield return(new WaitForSeconds(1.4f));

        // ボールを出す数
        int   gachaBallNum          = 20;
        int   count                 = 0;
        int   seed                  = 1;
        float gachaIntervalTimeBase = 0.8f;
        float gachaIntervalTime     = gachaIntervalTimeBase * gachaIntervalTimeBase;
        float ballSpeed             = 0.04f;
        float animatorSpeed         = 1.0f;

        while (gachaBallNum > count && titleAnimationPlaying)
        {
            gachaAnimator.SetTrigger("ShakeTrigger");
            aud.PlayOneShot(ballGenerateAudio);
            // 球の生成
            GachaGenerator(ballSpeed, seed++);
            count++;
            yield return(new WaitForSeconds(gachaIntervalTime));

            // 排出する時間を設定
            gachaIntervalTimeBase -= gachaIntervalTimeBase / gachaBallNum;
            gachaIntervalTime      = gachaIntervalTimeBase * gachaIntervalTimeBase;
            // 球のスピードを設定
            ballSpeed += ballSpeed * 0.03f;
            // アニメーションスピードを設定
            animatorSpeed += animatorSpeed * 0.02f;
            gachaAnimator.SetFloat("Speed", animatorSpeed);
        }

        if (!titleAnimationPlaying)
        {
            BgmManager.GetInstance().Play(BgmEnum.Title);
            yield break;
        }

        titleAnimator.SetTrigger("FadeTrigger");
        var anim = titleAnimator.GetCurrentAnimatorStateInfo(0);

        yield return(new WaitForSeconds(1.0f));

        BgmManager.GetInstance().Play(BgmEnum.Title);
    }
Example #29
0
 private void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
         DontDestroyOnLoad(gameObject);
     }
     else
     {
         Destroy(gameObject);
     }
     bgmManager = GetComponentInChildren <BgmManager>();
     seManager  = GetComponentInChildren <SeManager>();
 }
Example #30
0
    // SoundManager won't be destroy
    private void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        else if (instance != this)
        {
            Debug.Log("there is two BgmManager instance");
            Destroy(gameObject);
        }

        DontDestroyOnLoad(gameObject);
    }
Example #31
0
 void Awake()
 {
     bgmAudio             = gameObject.AddComponent <AudioSource>();
     bgmAudio.playOnAwake = false;
     if (instance == null)
     {
         instance = this;
     }
     else if (instance != null)
     {
         Destroy(gameObject);
     }
     DontDestroyOnLoad(gameObject);
 }
Example #32
0
        void Awake()
    {
                if(Instance != null)
        {
                        Destroy(gameObject);
                        return;
                    
        }
                Instance = this;
                DontDestroyOnLoad(gameObject);

                bgmAS = GetComponent <AudioSource> ();
            
    }
Example #33
0
    void Awake()
    {
        //-------------Singleton method--------------------------//
        if (instance == null)

            //if not, set instance to this
            instance = this;

        //If instance already exists and it's not this:
        else if (instance != this)
        {
            //Then destroy instance. This enforces new bgm on current scene.
            Destroy(instance.gameObject);

            //set instance to this new bgm manager until destroyed again
            instance = this;
        }

        //Sets this to not be destroyed when reloading scene
        DontDestroyOnLoad(gameObject);

        //--------------Singleton finished-----------------------//

        //Check if player already tune up the volume or not
        if (!PlayerPrefs.HasKey(ppBgmVolume))
        {
            PlayerPrefs.SetFloat(ppBgmVolume, 1f);
        }

        if (!PlayerPrefs.HasKey(ppMuteSounds))
        {
            PlayerPrefs.SetInt(ppMuteSounds, 0);
            mute = false;
        }
        else
        {
            if (PlayerPrefs.GetInt(ppMuteSounds) == 0)
                //if ppMuteSounds return 0 then mute
                mute = false;
            else
                //if not, ppMuteSounds should return 1 then
                mute = true;
        }

        bgmAudioSource = this.gameObject.GetComponent<AudioSource>();

        //to check the volume status when loading scene
        VolumeCheckUpdate();
    }
Example #34
0
    private void Awake()
    {
        orderMgr = FindObjectOfType<SpriteOrderLayerManager>();
        battleMgr = FindObjectOfType<BattleManager>();
        itemMgr = FindObjectOfType<ItemManager>();
        bgmMgr = FindObjectOfType<BgmManager>();
        isRun = true;
        pauseUI = FindObjectOfType<Pause>();
        isDefenceTurn = true;

        PlayerData.instance.CheckInstance();

        GameEventManager.instance.CheckInstance();

        StartCoroutine(SceneFader.Instance.FadeIn(0.6f));
        GameObject.FindObjectOfType<SceneFader>().transform.SetParent(Camera.main.transform, true);
    }
Example #35
0
    void Awake()
    {
        if (instance == null)

            //if not, set instance to this
            instance = this;

        //If instance already exists and it's not this:
        else if (instance != this)
        {
            //Then destroy instance. This enforces new bgm on current scene.
            Destroy(instance.gameObject);

            //set instance to this new bgm manager until destroyed again
            instance = this;
        }

        //Sets this to not be destroyed when reloading scene
        DontDestroyOnLoad(gameObject);
    }
Example #36
0
 void Awake()
 {
     bgmManager = ScriptableObject.FindObjectOfType<BgmManager>();
     sfxManager = ScriptableObject.FindObjectOfType<SfxManager>();
 }
Example #37
0
    void Start()
    {
        CloseOptionBoard();

        gameManager = ScriptableObject.FindObjectOfType<GameManager>();
        bgmManager = ScriptableObject.FindObjectOfType<BgmManager>();

        //to check the volume status when loading scene
        bgmManager.VolumeCheckUpdate();
    }