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>(); }
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); }
private void Update() { if (bgm == null) { bgm = GameObject.FindGameObjectWithTag("AudioManager").GetComponent <BgmManager>(); } }
void Awake() { if (BgmManager.instance == null) { BgmManager.instance = this; } }
// ----- // 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); }
private void PlayerDoDead() { BgmManager.StopBgm(); SoundManager.PlayAudio(SoundManager.dead); StartCoroutine(Dead(playerPos, true)); Destroy(playerZero.gameObject); }
internal void Update() { if (this.updateBgm) { BgmPlayer.Update(); BgmManager.Update(); } }
/*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(); } }
private void OnDisable() { BgmManager.PlayBgm(BgmManager.bossBgm); GameController.instance.canControll = true; boss.canMove = true; bossHpBar.SetActive(true); HumanAileAudioManager.instance.PlayAudio(HumanAileAudioManager.bossBattleStartAudio); }
private void Start() { fade = Fade.instance; fade.StartFadeIn(); aud = GetComponent <AudioSource>(); BgmManager.GetInstance().Stop(); StartCoroutine(Gacha()); }
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); }
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); }
public void CloseSingleton() { ViewAsync.ResetSignal(null); ViewString <long> .SetProvider(null); BgmManager.Stop(true); BgmManager.Reset(); BgmPlayer.Close(); }
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"; }
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); } }
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); }
// Use this for initialization void Start() { if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); } }
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; }
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()); }
void Update() { if (soundEffects == null) { soundEffects = GameObject.FindGameObjectWithTag("AudioManager").GetComponent <SoundEffectsManager>(); } if (bgm == null) { bgm = GameObject.FindGameObjectWithTag("AudioManager").GetComponent <BgmManager>(); } currState.UpdateState(); }
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); } }
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); }
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); }
private void Awake() { if (Instance == null) { Instance = this; DontDestroyOnLoad(gameObject); } else { Destroy(gameObject); } bgmManager = GetComponentInChildren <BgmManager>(); seManager = GetComponentInChildren <SeManager>(); }
// 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); }
void Awake() { bgmAudio = gameObject.AddComponent <AudioSource>(); bgmAudio.playOnAwake = false; if (instance == null) { instance = this; } else if (instance != null) { Destroy(gameObject); } DontDestroyOnLoad(gameObject); }
void Awake() { if(Instance != null) { Destroy(gameObject); return; } Instance = this; DontDestroyOnLoad(gameObject); bgmAS = GetComponent <AudioSource> (); }
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(); }
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); }
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); }
void Awake() { bgmManager = ScriptableObject.FindObjectOfType<BgmManager>(); sfxManager = ScriptableObject.FindObjectOfType<SfxManager>(); }
void Start() { CloseOptionBoard(); gameManager = ScriptableObject.FindObjectOfType<GameManager>(); bgmManager = ScriptableObject.FindObjectOfType<BgmManager>(); //to check the volume status when loading scene bgmManager.VolumeCheckUpdate(); }