/// <summary> /// 构造函数 /// </summary> /// <param name="data"></param> public DoorObject(Neptune.Door data) : base(data) { List <string> prefabPaths = DBManager.Instance.QuerySqliteField <string>(GlobalConfig.DBFile, "data_door", "id", data.ExcelId.ToString(), "res_path"); if (prefabPaths.Count > 0) { NodePrefabInfo prefabInfo = new NodePrefabInfo(); prefabInfo.PrefabFile = "Res" + prefabPaths[0] + ".prefab"; prefabInfo.LocalPosition = Vector3.zero; prefabInfo.LocalScale = Vector3.one; prefabInfo.LocalRotation = Quaternion.identity; mLoadPrefabCoroutine = LevelObjectHelper.SetObjectPrefab(gameObject, prefabInfo); } xc.Dungeon.LevelManager.Instance.SetAreaClose(1 << (1 + data.Flag)); }
/// <summary> /// 更新模型 /// </summary> void UpdateModel() { DestroyModel(); if (mDBConfig == null) { return; } NodePrefabInfo prefabInfo = new NodePrefabInfo(); bool isMiddleRes = false; string haveMiddleResStr = mDBConfig["has_middle_res"]; if (QualitySetting.GraphicLevel > 0 && string.IsNullOrEmpty(haveMiddleResStr) == false && haveMiddleResStr.Equals("1") == true) { isMiddleRes = true; } if (isMiddleRes == true) { prefabInfo.PrefabFile = "Res" + mDBConfig["res_path"] + "_middle.prefab"; } else { prefabInfo.PrefabFile = "Res" + mDBConfig["res_path"] + ".prefab"; } prefabInfo.LocalPosition = Vector3.zero; prefabInfo.LocalScale = Vector3.one; prefabInfo.LocalRotation = Quaternion.identity; mLoadPrefabCoroutine = LevelObjectHelper.SetObjectPrefab(gameObject, prefabInfo, () => { if (mGuildBossFireComponent != null) { mGuildBossFireComponent.OnResLoaded(); } }); }