//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // * New Method: Play Scene BGM //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ public void PlaySceneBGM() { if (m_oSubsceneAudioHandler != null) { AudioSourceManager.PlayAudioClip(m_oSubsceneAudioHandler); } }
protected override void OnDeath() { if (explosionSounds.Length > 0) { int soundIndex = Random.Range(0, explosionSounds.Length); AudioSourceManager.PlayOneShot(this.transform, explosionSounds[soundIndex], explosionVol); } else { Debug.Log("<Color=Red><b>Missing</b></Color> explosionSounds on EnemyHealth script on many Enemy GameObjects"); } if (scoreKeeper) { scoreKeeper.Killed(gameObject); } else { Debug.Log("ScoreKeeper missing from EnemyHealth", gameObject); } base.OnDeath(); if (PhotonNetwork.IsMasterClient) { PhotonNetwork.Destroy(gameObject); } }
// リモートプレイヤーが退室した時に呼ばれるメソッド void OnPhotonPlayerDisconnected(PhotonPlayer otherPlayer) { Debug.Log("log : リモートプレイヤーが退室しました"); switch (phase) { case PHASE.yetJoinedRoom: case PHASE.isWaiting: // まだ相手が接続していない段階なのでスルー break; case PHASE.isConnected: case PHASE.isReady: case PHASE.isPlaying: stopCanvas.SetActive(true); statusText1.text = "対戦相手との通信が切断されました"; AudioSourceManager.PlaySE(4); AudioSourceManager.audioBGM.Stop(); BackTitleCountdown3(); break; case PHASE.isEnded: Debug.Log("log : すでに勝敗がついています"); break; } }
protected Person(Person person) { // Copy the values name = person.name; gender = person.gender; hearing = person.hearing; scared = person.scared; buying = person.buying; angry = person.angry; sad = person.sad; speed = person.speed; voice = person.voice; walking = person.walking; paranoid = person.paranoid; robbed = person.robbed; running = person.running; walkingInterval = person.walkingInterval; stepPitch = person.stepPitch; hasPosition = person.hasPosition; timePassed = person.timePassed; gameObject = person.gameObject; position = person.position; sourceManager = new AudioSourceManager(gameObject); }
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // * New Method: Fadeout Tutorial //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ protected IEnumerator FadeoutTutorial() { // Fade out Tutorial BGM AudioSourceManager.FadeoutAudio(m_oAudioHandlerInfo); // Disappear/Fadeout Tutorial TextBox m_rTextBoxTransitionEffect.UnlockNoteObject(); m_rTextBoxTransitionEffect.Disappear(false); while (m_rTextBoxTransitionEffect.IsCurrentlyActive) { yield return(new WaitForEndOfFrame()); } // Fadeout Vignette. Only if nothing else is already Transitioning it~ if (!VignetteManager.IsTransitioning) { if (VignetteManager.CurrentColour.a > 0.05f) { float transitionTime = 0.5f; VignetteManager.TransitionVignette(0.0f, transitionTime); while (VignetteManager.IsTransitioning) { yield return(new WaitForEndOfFrame()); } } } this.gameObject.SetActive(false); }
//ボタンを押したらタイトルシーンに遷移 public void BackTitle() { Time.timeScale = 1; Invoke("toTitle", 0.25f); GameObject.Find("ReturnTitleButton").GetComponent <Animation>().Play(); AudioSourceManager.PlaySE(3); }
// CCU上限を超えた時に呼ばれるメソッド void OnPhotonMaxCccuReached() { Debug.Log("log : 同時接続人数が20人を超えました"); switch (phase) { case PHASE.yetJoinedRoom: case PHASE.isWaiting: statusText.text = ""; networkImg.enabled = false; loadingImg.SetActive(false); backButton.SetActive(false); stopCanvas.SetActive(true); statusText1.text = "ネットワークに接続していません\n通信の安定した場所で再度プレイしてください"; AudioSourceManager.PlaySE(4); AudioSourceManager.audioBGM.Stop(); BackTitleCountdown3(); break; case PHASE.isConnected: case PHASE.isReady: case PHASE.isPlaying: stopCanvas.SetActive(true); statusText1.text = "現在同時接続人数が上限を超えています\n時間を置いて再度プレイしてください"; AudioSourceManager.PlaySE(4); AudioSourceManager.audioBGM.Stop(); BackTitleCountdown3(); break; case PHASE.isEnded: Debug.Log("log : すでに勝敗がついています"); break; } }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET: //ORIGINAL LINE: private void encodeTrackDetails(AudioTrack track, DataOutput output) throws IOException private void encodeTrackDetails(AudioTrack track, DataOutput output) { AudioSourceManager sourceManager = track.SourceManager; output.writeUTF(sourceManager.SourceName); sourceManager.encodeTrack(track, output); }
private void playSoundEffect() { AudioSourceManager.PlayAudioOneShot(soundEffect.GetAudioClip(), soundEffect.GetVolume(), soundEffect.GetPitch(), soundEffect.GetSpatialBlend()); }
// Stops a given sound effect. // Note: this will fire a stopped sound effect event if that was setup for the sound effect. public void StopSFX(AudioSourceManager sfx) { if (sfx != null) { sfx.Stop(); } }
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // * New Method: Play Button Sound //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ public virtual void PlayButtonSound() { if (m_acClipToPlay != null) { AudioSourceManager.PlayAudioClip(m_acClipToPlay); } }
// Pauses a given sound effect. // Note: this will fire a paused sound effect event if that was setup for the sound effect. public void PauseSFX(AudioSourceManager sfx) { if (sfx != null) { sfx.Pause(); } }
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // * New Method: Perform Rattle Shake Check //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ private bool PerformRattleShakeCheck() { // Increment Current Consecutive Shakes Count m_iCurrentRattleShakes += 1; // If the user took too long to make another shake, reset the rattle count if (m_ttRattleTimer.TimeUp()) { m_iCurrentRattleShakes = 1; } // Reset Rattle timer (it would be unfair if we didn't reset the timer and allow the user as much time as possible to make another shake occur) m_ttRattleTimer.Reset(); // Got enough shakes? Awesome. Make the Rattle Sound if (m_iCurrentRattleShakes >= m_iRattleShakesNeeded) { if (!m_bSoundPlayed) { AudioSourceManager.PlayAudioClip(m_rTambSoundManager.GetTambourineSound(TambourineSoundsManager.SoundTypes.RATTLE_TAMBOURINE_SHAKE)); ShowShakenTambourine(); } m_bSoundPlayed = true; return(true); } return(false); }
public UIFacade(UIManager uiManager) { mGameManager = GameManager.Instance; mPlayerManager = mGameManager.playerManager; mUIManager = uiManager; mAudioSourceManager = mGameManager.audioSourceManager; }
//ボタンを押したらリザルトシーンに遷移 public void GotoResult() { Invoke("toResult", 0.25f); GameObject.Find("NextButton").GetComponent <Animation>().Play(); AudioSourceManager.PlaySE(2); AudioSourceManager.audioBGM.loop = true; }
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // * Derived Method: On Trigger //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ protected override void OnTrigger() { base.OnTrigger(); StartCymbalShake(m_fTotalShakeTime); // Challenge Mode Active? Make Sure Sound can be played before it will can be heard if (m_rChallengeGameManager != null && m_rChallengeGameManager.Active) { if (m_rChallengeGameManager.IsChallenge) { m_rChallengeGameManager.SuccessfulHit(m_eSoundType); if (m_rSoundManager != null) { AudioSourceManager.PlayAudioClip(m_rSoundManager.GetTambourineSound(m_eSoundType)); if (m_rTambInstrumentManager != null) { m_rTambInstrumentManager.CurrentInstrumentHitCount += 1; } } } } // Otherwise Play Normally. else if (m_rSoundManager != null) { AudioSourceManager.PlayAudioClip(m_rSoundManager.GetTambourineSound(m_eSoundType)); if (m_rTambInstrumentManager != null) { m_rTambInstrumentManager.CurrentInstrumentHitCount += 1; } } }
//ボタンを押したら再開 public void ReStartGame() { Time.timeScale = 1; Invoke("ReStart", 0.25f); GameObject.Find("BackButton").GetComponent <Animation>().Play(); AudioSourceManager.PlaySE(3); }
void Start() { // 端末内保存情報からユーザー情報を抽出 id = PlayerPrefs.GetString("ID"); playerName = PlayerPrefs.GetString("PlayerName"); winCount = PlayerPrefs.GetInt("WinCount"); loseCount = PlayerPrefs.GetInt("LoseCount"); playCount = winCount + loseCount; if (playCount == 0) { winPercent = 0; } else { winPercent = (float)winCount / playCount; } // UI表示 nameText.text = playerName; countText.text = winCount.ToString().PadLeft(3, '0') + "勝 / " + loseCount.ToString().PadLeft(3, '0') + "敗"; percentGraoh.fillAmount = winPercent; percentText.text = (winPercent * 100).ToString("f1") + "%"; inputCanvas.enabled = false; GetRanking(); AudioSourceManager.PlayBGM(bgm); }
public void OkButton() { errorText.SetActive(false); NCMBObject database = new NCMBObject("DataBase"); string id = Guid.NewGuid().ToString(); database["id"] = id; database["name"] = inputField.text; database["winCount"] = 0; database["loseCount"] = 0; database.SaveAsync((NCMBException e) => { if (e == null) { PlayerPrefs.SetString("ID", id); PlayerPrefs.SetString("PlayerName", inputField.text); PlayerPrefs.SetInt("WinCount", 0); PlayerPrefs.SetInt("LoseCount", 0); PlayerPrefs.SetInt("FirstOpen", 1); Invoke("toTitle", 0.25f); AudioSourceManager.PlaySE(1); } else { errorText.SetActive(true); AudioSourceManager.PlaySE(4); } }); GameObject.Find("OkButton").GetComponent <Animation>().Play(); }
public void FinisyEditNameButton() { errorText.SetActive(false); NCMBQuery <NCMBObject> query = new NCMBQuery <NCMBObject> ("DataBase"); query.WhereEqualTo("id", id); query.FindAsync((List <NCMBObject> objList, NCMBException e) => { if (e == null) // データの検索が成功したら、 { objList[0]["name"] = inputField.text; objList[0].SaveAsync((NCMBException e2) => { if (e2 == null) { GetRanking(); } }); playerName = inputField.text; nameText.text = playerName; PlayerPrefs.SetString("PlayerName", playerName); inputCanvas.enabled = false; AudioSourceManager.PlaySE(1); } else { errorText.SetActive(true); AudioSourceManager.PlaySE(4); } }); }
private void Awake() { DontDestroyOnLoad(this.gameObject); Instance = this; //加载资源包 UIPackage.AddPackage("UI/Res_Main"); UIPackage.AddPackage("UI/Res_Game"); UIPackage.AddPackage("UI/Res_Component"); UIConfig.defaultFont = "汉仪南宫体简"; UIConfig.buttonSound = buttonSound; GRoot.inst.SetContentScaleFactor(1600, 900, UIContentScaler.ScreenMatchMode.MatchWidthOrHeight); if (currentUIManager == null) { currentUIManager = new UIMananger(); currentUIManager.MainUIManager(); } if (audioSourceManager == null) { audioSourceManager = new AudioSourceManager(this); } if (messageManager == null) { messageManager = new MessageManager(); messageManager.InitMessage(); } }
public void SetScore() { nowLoadingCanvas.SetActive(true); AudioSourceManager.PlaySE(2); NCMBQuery <NCMBObject> query = new NCMBQuery <NCMBObject> ("DataBase"); query.WhereEqualTo("id", id); query.FindAsync((List <NCMBObject> objList, NCMBException e) => { if (e == null) { // データベースを更新 objList[0]["winCount"] = newWinCount; objList[0]["loseCount"] = newLoseCount; objList[0].SaveAsync(); PlayerPrefs.SetInt("WinCount", newWinCount); PlayerPrefs.SetInt("LoseCount", newLoseCount); nowLoadingCanvas.SetActive(false); finishLoadingCanvas.SetActive(true); AudioSourceManager.PlaySE(6); } else { // ネットワークに接続していない時 nowLoadingCanvas.SetActive(false); failedLoadingCanvas.SetActive(true); AudioSourceManager.PlaySE(4); } }); }
public void VoiceButton() { int rand = Random.Range(0, 6); int chara = PlayerPrefs.GetInt("chara", 0); for (int i = 0; i < SelectCostumeManager.CHARA_MAX; i++) { animators[i].SetTrigger(rand.ToString()); } switch (OfflineCharaSet.GetCharaNum(chara)) { case 0: AudioSourceManager.PlayVOICE(unityVoice[rand]); break; case 1: AudioSourceManager.PlayVOICE(misakiVoice[rand]); break; case 2: AudioSourceManager.PlayVOICE(yukoVoice[rand]); break; } t = 1; }
void onCollectablePickedup(CollectablePickedupEvent collectablePickedup) { AudioSourceManager.PlayAudioOneShot(collectableSFX.GetAudioClip(), collectableSFX.GetVolume(), collectableSFX.GetPitch(), collectableSFX.GetSpatialBlend()); }
void ShowResult() { Time.timeScale = 1f; // 勝った方のキャラのWinモーション再生 GameObject winPlayer = GameObject.FindWithTag(winPlayerTag); winPlayer.transform.Find("UTC_Default").gameObject.GetComponent <Animator>().SetTrigger("Win"); winPlayer.transform.eulerAngles = new Vector3(0, 180, 0); resultCanvas.SetActive(true); if (winPlayerTag == "myPlayer") { // 自分が勝った resultText.text = "You Win!"; ResultManager.result = "WIN"; AudioClip clip = winVoice[OfflineCharaSet.GetCharaNum(myPlayerPlayerController.chara)]; AudioSourceManager.PlayVOICE(clip); AudioSourceManager.audioBGM.loop = false; AudioSourceManager.PlayBGM(endBGMs[0]); } else { // 相手が勝った resultText.text = "You Lose..."; ResultManager.result = "LOSE"; AudioSourceManager.audioBGM.loop = false; AudioSourceManager.PlayBGM(endBGMs[1]); } }
void playEmptySound() { AudioSourceManager.PlayAudioOneShot(sprayEmpty.GetAudioClip(), sprayEmpty.GetVolume(), sprayEmpty.GetPitch(), sprayEmpty.GetSpatialBlend()); }
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // * Derived Method: Start //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ void Start() { // Set DSP Buffer Size #if !UNITY_EDITOR && !UNITY_STANDALONE_WIN && !UNITY_STANDALONE_OSX var audioSettings = AudioSettings.GetConfiguration(); audioSettings.dspBufferSize /= 2; AudioSettings.Reset(audioSettings); #endif Instance = this; // Grab all Audio Sources already existing on this object sm_aAudioSource.Clear(); AudioSource[] acquiredAudioSources = this.gameObject.GetComponents <AudioSource>(); if (acquiredAudioSources.Length > m_iTotalAudioSourcesCount) { m_iTotalAudioSourcesCount = acquiredAudioSources.Length; } // Add Existing To List for (int i = 0; i < acquiredAudioSources.Length; ++i) { sm_aAudioSource.Add(new AudioHandlerManager(acquiredAudioSources[i])); } // Create the rest of the AudioSources up until the desired amount exist. Or stop if we already have more than required. for (int i = sm_aAudioSource.Count; i < m_iTotalAudioSourcesCount; ++i) { sm_aAudioSource.Add(new AudioHandlerManager(CreateAudioSource())); } }
public UIFacade(UIManger uiManager) { this.uiManger = uiManager; gameManager = GameManager.Instance; playerManager = GameManager.Instance.playerManager; audioSourceManager = GameManager.Instance.audioSourceManager; InitMask(); }
// 构造函数 public UIFacade(UIManager uiManager) { mUIManager = uiManager; mGameManager = GameManager.Instance; mAudioSourceManager = mGameManager.audioSourceManager; mPlayManager = mGameManager.playerManager; InitMask(); // 初始化遮罩 }
//ボタンを押したら一時停止 public void StopGame() { isPlaying = false; Time.timeScale = 0; AudioSourceManager.PlaySE(4); AudioSourceManager.audioBGM.Pause(); stopCanvas.SetActive(true); }
void Start() { audioSourceMngr = GetComponent<AudioSourceManager>(); timer = timerStart; foreach(GameObject go in GameObject.FindGameObjectsWithTag("Guest")) { guestCount += 1; guests.Add(go); } foodMeterStart = foodMeter; foodMeter = greaseLevel; foodEatInterval = foodMeter/ (foodMeterStart); uiRootInst = Instantiate(uiRoot, new Vector3(9999,9999,9999), uiRoot.transform.rotation) as GameObject; foodbarSprite = uiRootInst.GetComponentInChildren<UISprite>(); foodbarSprite.color = topColor; camShake = GetComponent<CameraShake>(); cam = Camera.main.transform; foodParticleInst = Instantiate(foodParticle, cam.transform.position + new Vector3(cam.transform.forward.x, cam.transform.forward.y - 0.5f, cam.transform.forward.z), foodParticle.transform.rotation) as GameObject; foodParticleSystem = foodParticleInst.GetComponent<ParticleSystem>(); crosshair = cam.GetComponent<Crosshair>(); comboCounterGui = uiRootInst.transform.Find("ComboCount").gameObject.GetComponent<UILabel>(); goldCounterGui = uiRootInst.transform.Find("GoldCount").gameObject.GetComponent<UILabel>(); goldCounterGui = uiRootInst.transform.Find("GoldCount").gameObject.GetComponent<UILabel>(); timerGui = uiRootInst.transform.Find("Time").gameObject.GetComponent<UILabel>(); gameOverGui = uiRootInst.transform.Find("GameOver").gameObject.GetComponent<UILabel>(); gameOverGui.enabled = false; // audioSourceMngr.PlaySource("AS_StartHunger" ,false); timeBetweenFill = Random.Range(15, 30); }