Example #1
0
        protected void ReplaceWord(ref string sOriginal, BaseDialogueReplace hReplace)
        {
            var sReplaceID = hReplace.id;

            if (!TryGetReplaceData(hReplace, out var hData))
            {
                Debug.LogWarning("Don't have replace word '" + sReplaceID + "' in data.", gameObject);
                return;
            }

            sOriginal = sOriginal.Replace(sReplaceID, hData.replaceWord);
        }
Example #2
0
 protected bool TryGetReplaceData(BaseDialogueReplace hReplace, out BaseDialogueReplaceData hData)
 {
     hData = GetReplaceData(hReplace);
     return(hData != null);
 }
Example #3
0
 protected BaseDialogueReplaceData GetReplaceData(BaseDialogueReplace hReplace)
 {
     return(hReplace.replaceData);
 }
Example #4
0
        protected void ReplaceColor(ref string sOriginal, BaseDialogueReplace hReplace)
        {
            string sColorWord = "<color=#" + hReplace.replaceColor + ">" + hReplace.id + "</color>";

            sOriginal = sOriginal.Replace(hReplace.id, sColorWord);
        }