//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: // PROTECTED FUNCTION //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: // @Brief : Execution with option // @Param : uId => Value of "No" column of csv // : pManager => Charageki manager protected override void Exec(uint uId, KrCharagekiManager pManager) { KrCharagekiScenarioContainer pScenarioContainer = pManager.GetScenarioContainer(); // Get row data of csv KrCsvDataRow pCsvDataRow = pScenarioContainer.GetScenario(uId.ToString(), "No"); uint uCharaId = 0; bool bIsSuccess = uint.TryParse(pCsvDataRow.GetValue("CharaId"), out uCharaId); KrDebug.Assert(bIsSuccess, "Parsing failed to type int = " + pCsvDataRow.GetValue("CharaId"), typeof(KrCharagekiCommandSetText)); KrDebug.Assert(KrCharagekiDef.s_pCHARA_DIC.ContainsKey(uCharaId), "Invalid KrCharagekiDef.s_CHARA_NAME key = " + uCharaId, typeof(KrCharagekiCommandSetText)); string pCharaName = KrCharagekiDef.s_pCHARA_DIC[uCharaId].GetCharacterName(); string pComment = pCsvDataRow.GetValue("Comment"); KrDebug.Log("Play Text : " + "CharaId" + " = " + pCharaName + ", " + "Comment" + " = " + pComment, typeof(KrCharagekiCommandSetText)); KrCharagekiUIController pUIController = pManager.GetUIController(); // Set text float fReadingTime = pUIController.SetText(pCharaName, pComment); // Play voice string pVoiceName = pCsvDataRow.GetValue("VoiceId"); KrDebug.Log("Play Voice: " + "CharaId" + " = " + pCharaName + ", " + "VoiceId" + " = " + pVoiceName, typeof(KrCharagekiCommandSetText)); KrAudioSource pAudioSource = pUIController.PlayVoice(uCharaId, pVoiceName, pManager); if (pAudioSource == null) { // If there is no voice data, set the lip sync time from the length of the text pUIController.PlayLipSync(uCharaId, fReadingTime, pComment); } // Set log KrCharagekiLog pLog = new KrCharagekiLog(pCharaName, pComment); KrCharagekiLogContainer pLogContainer = pManager.GetLogContainer(); pLogContainer.AddLog(pLog); }
// @Brief : Set row values // @Param : pValues => Array of column value public void SetRow(string[] pValues) { KrCsvDataRow pRow = new KrCsvDataRow(m_pColumnNames, pValues); m_pRows.Add(pRow); }
// @Brief : Get value // @Param : sRow => Index of row // : sColumn => Index if column // @Return : Cell value public string GetValue(int sRow, int sColumn) { KrCsvDataRow pRowData = GetValues(sRow); return(pRowData.GetValue(sColumn)); }
// @Brief : Get value // @Param : pRowData => Row data // : pColumnName => Column Name // @Return : Cell value public string GetValue(KrCsvDataRow pRowData, string pColumnName) { int sColumn = GetColumnIndex(pColumnName); return(pRowData.GetValue(sColumn)); }