public override void Dispose() { base.Dispose(); if (_flyingList != null) { _flyingList.Clear(); } }
public override void Dispose() { base.Dispose(); if (_occupyTemplates != null) { _occupyTemplates.Clear(); } }
private void LoadTemplates() { TemplateList.Clear(); if (Directory.Exists($"{ Constants.ContentPath + (int)ProductType }\\user_templates\\")) { foreach (var path in Directory.GetFiles($"{ Constants.ContentPath + (int)ProductType }\\user_templates\\")) { var pathfix = path.Replace("BBTEL", "BB/TEL"); if (!string.IsNullOrEmpty(BreakerSelected) && !pathfix.Contains(BreakerSelected)) { continue; } if (!string.IsNullOrEmpty(OperatingCurrentSelected) && !pathfix.Contains(OperatingCurrentSelected)) { continue; } if (SectionsAmountIndex == 1 && !Regex.IsMatch(pathfix, @".+\(\d+\).+")) { continue; } if (SectionsAmountIndex == 2 && !Regex.IsMatch(pathfix, @".+\(\d+\,\d\).+")) { continue; } _userTemplates.Add(path); TemplateList.Add(Path.GetFileNameWithoutExtension(path)); } } if (Directory.Exists($"{ Constants.ContentPath + (int)ProductType }\\templates\\")) { foreach (var path in Directory.GetFiles($"{ Constants.ContentPath + (int)ProductType }\\templates\\")) { var pathfix = path.Replace("BBTEL", "BB/TEL"); if (!string.IsNullOrEmpty(BreakerSelected) && !pathfix.Contains(BreakerSelected)) { continue; } if (!string.IsNullOrEmpty(OperatingCurrentSelected) && !pathfix.Contains(OperatingCurrentSelected)) { continue; } if (SectionsAmountIndex == 1 && !Regex.IsMatch(pathfix, @".+\(\d+\).+")) { continue; } if (SectionsAmountIndex == 2 && !Regex.IsMatch(pathfix, @".+\(\d+\,\d\).+")) { continue; } _appTemplates.Add(path); TemplateList.Add(Path.GetFileNameWithoutExtension(path)); } } }
private void updateAllowedTemplates() { CanUseExitingTemplate = true; CanCreateTemplate = true; Parameters.Clear(); string[] paramTypes = PreprocessingManager.PrepManager.getParametersTypes(FilePath, delimiter.ToCharArray()[0], HasHeader, EnumPercent); string[] parametersName = null; if (HasHeader) { parametersName = PreprocessingManager.PrepManager.getParametersName(); } int step = 0; foreach (string type in paramTypes) { step++; string name = "Parameter " + step; if (HasHeader) { name = parametersName[step - 1]; } Parameters.Add(new ParameterCreationViewModel(step, name, type + "(" + EnumPercent + ")", false)); } CountRows = PreprocessingManager.PrepManager.getCountRows(); TemplateList.Clear(); List <Entity> templates = searchTaskTemplates(paramTypes); Pair pair = new Pair(); if (templates.Count != 0) { pair.Id = templates[0].ID; pair.Name = TemplateList[0]; } else { pair.Id = 1; pair.Name = ""; } SelectedTemplate = pair; }
//---------------------------------------------------------------------------- // @brief ボイス再生 // @param[in] fix_id オーディオ再生情報マスターFixID // @param[out] playTime クリップの長さ //---------------------------------------------------------------------------- public void PlayVoice(uint fix_id, out float playTime) { playTime = 0.0f; try { if (m_AudioClipTable == null) { return; } MasterDataAudioData audioData = GetAudioMaster(fix_id); if (audioData == null) { return; } if (audioData.res_name != string.Empty) { AudioClip clip; bool ret; // fix_idに該当するオーディオクリップの取得 ret = m_AudioClipTable.TryGetValue(fix_id, out clip); if (ret) { // 通常再生 m_AudioSrcVoice.PlayOneShot(m_AudioClipTable[fix_id], audioData.vol_lv / 100.0f); if (audioData.ducking_disable != MasterDataDefineLabel.BoolType.ENABLE) { // 再生時間を返す playTime = m_AudioClipTable[fix_id].length; } } } else { // ランダム再生 m_WorkSelectVoice.Clear(); uint id = 0; if (audioData.rand_id_00 != 0) { m_WorkSelectVoice.Add(audioData.rand_id_00); } if (audioData.rand_id_01 != 0) { m_WorkSelectVoice.Add(audioData.rand_id_01); } if (audioData.rand_id_02 != 0) { m_WorkSelectVoice.Add(audioData.rand_id_02); } if (audioData.rand_id_03 != 0) { m_WorkSelectVoice.Add(audioData.rand_id_03); } if (audioData.rand_id_04 != 0) { m_WorkSelectVoice.Add(audioData.rand_id_04); } if (audioData.rand_id_05 != 0) { m_WorkSelectVoice.Add(audioData.rand_id_05); } int nSelect = (int)RandManager.GetRand(0, (uint)m_WorkSelectVoice.m_BufferSize); id = m_WorkSelectVoice[nSelect]; // 再生する音が選択できたらもう一度呼出 PlayVoice(id, out playTime); } } catch (Exception e) { Debug.LogError(e.Message); } }