public static void ParseData(string content, string fileName) { metaData = new Dictionary <int, MusicAssetsData> (); CSVParser parser = new CSVParser(); if (!parser.Parse(content)) { ClientLog.Instance.LogError("UIAssetsData" + ConfigLoader.Instance.csvext + "解析错误"); return; } int recordCounter = parser.GetRecordCounter(); MusicAssetsData data = null; for (int i = 0; i < recordCounter; ++i) { data = new MusicAssetsData(); data.id_ = parser.GetInt(i, "ID"); data.assetsName_ = parser.GetString(i, "AssetName"); if (metaData.ContainsKey(data.id_)) { ClientLog.Instance.LogError("UIAssetsData" + ConfigLoader.Instance.csvext + "ID重复"); return; } metaData[data.id_] = data; } parser.Dispose(); parser = null; }
public string GetAssetsName(int AssetsID, AssetLoader.EAssetType Type) { string AssetsName = ""; if (Type == AssetLoader.EAssetType.ASSET_EFFECT) { EffectAssetsData AssetsData = EffectAssetsData.GetData(AssetsID); if (null == AssetsData) { return(""); } AssetsName = AssetsData.assetsName_; } else if (Type == AssetLoader.EAssetType.ASSET_PLAYER || Type == AssetLoader.EAssetType.ASSET_WEAPON) { EntityAssetsData AssetsData = EntityAssetsData.GetData(AssetsID); if (null == AssetsData) { return(""); } AssetsName = AssetsData.assetsName_; } else if (Type == AssetLoader.EAssetType.ASSET_UI) { UIAssetsData AssetsData = UIAssetsData.GetData(AssetsID); if (null == AssetsData) { return(""); } AssetsName = AssetsData.assetsName_; } else if (Type == AssetLoader.EAssetType.ASSET_SOUND) { SoundAssetsData AssetsData = SoundAssetsData.GetData(AssetsID); if (null == AssetsData) { return(""); } AssetsName = AssetsData.assetsName_; } else if (Type == AssetLoader.EAssetType.ASSET_MUSIC) { MusicAssetsData AssetsData = MusicAssetsData.GetData(AssetsID); if (null == AssetsData) { return(""); } AssetsName = AssetsData.assetsName_; } return(AssetsName); }
public static void ExcuteLoadedEvent() { Transform trans = null; if (ApplicationEntry.Instance != null) { for (int i = 0; i < ApplicationEntry.Instance.uiRoot.transform.childCount; ++i) { trans = ApplicationEntry.Instance.uiRoot.transform.GetChild(i); if (trans.gameObject.name.Equals("NameLabel")) { GameObject.Destroy(trans.gameObject); } } } Loading = false; if (OnSceneLoaded != null) { OnSceneLoaded(Scene_name); } SceneData sd = SceneData.GetData(GameManager.SceneID); if (sd == null) { return; } MusicAssetsData mdata = MusicAssetsData.GetData(sd.M_ID); if (!GlobalValue.isBattleScene(Scene_name)) { SoundTools.PlayMusic((MUSIC_ID)mdata.id_); } if (!BagSystem.instance.IsInit && !Scene_name.Equals("LoginScene") && !Scene_name.Equals("CreateRoleScene")) { NetConnection.Instance.requestBag(); } }
static public void OpenMusic() { PlayerPrefs.SetInt("settingMusic", 0); settingDirty = true; int mucId = 0; if (GamePlayer.Instance.isInBattle) { if (Battle.Instance.battleType == BattleType.BT_PVE) { if (Battle.Instance.BattleID == 0) { GlobalValue.Get(Constant.C_BossMuc, out mucId); PlayMusic((MUSIC_ID)mucId); } else { GlobalValue.Get(Constant.C_PutnMuc, out mucId); PlayMusic((MUSIC_ID)mucId); } } else if (Battle.Instance.battleType == BattleType.BT_PVP) { GlobalValue.Get(Constant.C_PvpMuc, out mucId); PlayMusic((MUSIC_ID)mucId); } } else { SceneData sd = SceneData.GetData(GameManager.SceneID); if (sd == null) { return; } MusicAssetsData mdata = MusicAssetsData.GetData(sd.M_ID); PlayMusic((MUSIC_ID)mdata.id_); } }