//! 초기화 public override void Awake() { base.Awake(); // 카메라를 설정한다 this.SetupUICamera(); this.SetupMainCamera(); // 싱글턴 객체를 생성한다 CSoundManager.Create(); CResourceManager.Create(); CUnityMessageSender.Create(); CDeviceMessageReceiver.Create(); CItemStorage.Create(); CPlayerStorage.Create(); CCardStorage.Create(); CEnemyStorage.Create(); // 문자열 리스트를 불러온다 CLocalizeManager.Instance.ResetStringList(); CLocalizeManager.Instance.LoadStringListFromFile("Datas/Localize/EN_LocalizeStrings"); // 해상도를 변경한다 Screen.SetResolution(KDefine.SCREEN_WIDTH, KDefine.SCREEN_HEIGHT, false); }
public bool LoadSoundInfo() { string SoundInfoFilePath = GetFilePath(ESaveFileName.SoundSettingSaveData); if (!CheckFilePath(SoundInfoFilePath)) { return(false); } string file = File.ReadAllText(SoundInfoFilePath); float[] values = new float[2]; string[] tmp = file.Split(','); for (int i = 0; i < tmp.Length; i++) { values[i] = float.Parse(tmp[i]); } CSoundManager.GetInstance().BackgroundVolume = values[0]; CSoundManager.GetInstance().EffectVolume = values[1]; return(true); }
// Start is called before the first frame update void Awake() { foreach (SSoundInfo SoundInfo in SoundInfoList) { CSoundManager.AddSound(SoundInfo); } }
private void OnDestroy() { foreach (SSoundInfo SoundInfo in SoundInfoList) { CSoundManager.RemoveSound(SoundInfo.Id); } }
void Start() { CSoundManager._instance = this; AS_Audio = this.gameObject.AddComponent <AudioSource>(); AS_Audio.clip = this.AC_Sound[AC_Sound.Length - 1]; AS_Audio.loop = false; }
protected override void InitOption() { SliderOption.minValue = 0; SliderOption.maxValue = 100; float value = CSoundManager.GetInstance().BackgroundVolume * 100; SliderOption.value = value; DisplayText.text = value.ToString(); }
public static CSoundManager GetInstance() { if (Instance == null) { Instance = new CSoundManager(); } return(Instance); }
void Awake() { if (Inst != null) { Destroy(this.gameObject); return; } Inst = this; DontDestroyOnLoad(gameObject); }
void Start() { m_soundMgr = CSoundManager.Inst; m_bgmSource = GetComponent <AudioSource>(); if (m_titleBgm == null) { m_titleBgm = Resources.Load("Sounds/Bgm/stress_test") as AudioClip; } m_mainMenuUI.SetActive(true); m_optionUI.SetActive(false); }
public static void RemoveSound(string Id) { if (!HasSound(Id)) { return; } CSoundManager Manager = GetInstance(); SSound Sound = Manager.SoundMap[Id]; if (!Sound.IsConstant) { Manager.SoundMap.Remove(Id); } }
public static void PlaySound(string Id) { if (!HasSound(Id)) { return; } CSoundManager Instance = GetInstance(); SSound Sound = Instance.SoundMap[Id]; if (Sound.Type == ESoundType.Effect) { Instance.SoundPlayer.PlayOneShot(Sound.Clip, Instance.EffectVolume); } else if (Sound.Type == ESoundType.Background) { Instance.SoundPlayer.Stop(); Instance.SoundPlayer.clip = Sound.Clip; Instance.SoundPlayer.Play(); } }
public void Save() { StrBuilder.Clear(); //ESaveFileName 순으로 초기화 string[] json = new string[4]; json[0] = JsonUtility.ToJson(CGameInputManager.GetInstance()); StrBuilder.Append(CSoundManager.GetInstance().BackgroundVolume.ToString()); StrBuilder.Append(","); StrBuilder.Append(CSoundManager.GetInstance().EffectVolume.ToString()); json[1] = StrBuilder.ToString(); json[2] = JsonUtility.ToJson(CUserInfo.GetInstance()); json[3] = JsonUtility.ToJson(CUserInfo.GetInstance().QuestLst); for (int i = 0; i < json.Length; i++) { ESaveFileName FileName = (ESaveFileName)i; Debug.Log(json[i]); File.WriteAllText(GetFilePath(FileName), json[i]); } }
public override void Awake() { base.Awake(); //this.SetupUICamera(); //this.SetupMainCamera(); CResourceManager.Create(); CSoundManager.Create(); CPopupManager.Create(); CEffectManager.Create(); CWeaponManager.Create(); CItemManager.Create(); CEnemyManager.Create(); CStageManager.Create(); CMerchandiseManager.Create(); //에너미패턴 매니저의 경우 로비씬에서 크리에이트 해야 된다. 지금은 테스트용이라 여기에 해놈 CEnemyPatternManager.Create(); //CLocalizeManager.Instance.ResetDict(); //CLocalizeManager.Instance.LoadStringListFromFile(); Application.targetFrameRate = 60; Screen.SetResolution(KDefine.SCREEN_WIDTH, KDefine.SCREEN_HEIGHT, true); }
protected override void SetOption(float value) { CSoundManager.GetInstance().BackgroundVolume = value / 100f; DisplayText.text = value.ToString(); }
private void EngineSound() { audioSource.pitch = (GetComponent <Rigidbody>().velocity.magnitude * 3.6f / CarInfo.MaxSpeed + 1) * CSoundManager.GetInstance().EffectVolume; }