Exemplo n.º 1
0
 //自動改行などのために線を増やす必要がある場合
 UguiNovelTextGeneratorAdditionalLine(UguiNovelTextGeneratorAdditionalLine srcLine, int index, int count, UguiNovelTextGenerator generator)
 {
     InitSub(srcLine.type, generator);
     for (int i = 0; i < count; ++i)
     {
         stringData.Add(srcLine.stringData[index + i]);
     }
 }
Exemplo n.º 2
0
 private UguiNovelTextGeneratorAdditionalLine(UguiNovelTextGeneratorAdditionalLine srcLine, int index, int count, UguiNovelTextGenerator generator)
 {
     this.stringData = new List <UguiNovelTextCharacter>();
     this.InitSub(srcLine.type, generator);
     for (int i = 0; i < count; i++)
     {
         this.stringData.Add(srcLine.stringData[index + i]);
     }
 }
Exemplo n.º 3
0
        //改行などで別の行に線を引く必要があるばあい、その線を作成
        internal List <UguiNovelTextGeneratorAdditionalLine> MakeOtherLineInTextLineSub(UguiNovelTextGenerator generator)
        {
            List <UguiNovelTextGeneratorAdditionalLine> newLineList = new List <UguiNovelTextGeneratorAdditionalLine>();

            int endIndex = stringData.Count - 1;

            foreach (UguiNovelTextLine line in generator.LineDataList)
            {
                if (textLine == line)
                {
                    continue;
                }

                bool isFind = false;
                int  index  = 0;
                int  count  = 0;
                for (int i = 0; i < stringData.Count; ++i)
                {
                    //他の行に文字がある
                    if (line.Characters.IndexOf(stringData[i]) >= 0)
                    {
                        if (!isFind)
                        {
                            index    = i;
                            endIndex = Mathf.Min(i, endIndex);
                            isFind   = true;
                        }
                        ++count;
                    }
                }
                if (isFind)
                {
                    UguiNovelTextGeneratorAdditionalLine newLine = new UguiNovelTextGeneratorAdditionalLine(this, index, count, generator);
                    newLineList.Add(newLine);
                    newLine.InitTextLine(generator);
                    if (!newLine.characteData.TrySetCharacterInfo(generator.NovelText.font))
                    {
                        Debug.LogError("Line Font Missing");
                    }
                }
            }
            if (newLineList.Count > 0)
            {
                stringData.RemoveRange(endIndex, stringData.Count - endIndex);
            }
            return(newLineList);
        }
Exemplo n.º 4
0
        internal List <UguiNovelTextGeneratorAdditionalLine> MakeOtherLineInTextLineSub(UguiNovelTextGenerator generator)
        {
            List <UguiNovelTextGeneratorAdditionalLine> list = new List <UguiNovelTextGeneratorAdditionalLine>();
            int index = this.stringData.Count - 1;

            foreach (UguiNovelTextLine line in generator.LineDataList)
            {
                if (this.textLine != line)
                {
                    bool flag  = false;
                    int  num2  = 0;
                    int  count = 0;
                    for (int i = 0; i < this.stringData.Count; i++)
                    {
                        if (line.Characters.IndexOf(this.stringData[i]) >= 0)
                        {
                            if (!flag)
                            {
                                num2  = i;
                                index = Mathf.Min(i, index);
                                flag  = true;
                            }
                            count++;
                        }
                    }
                    if (flag)
                    {
                        UguiNovelTextGeneratorAdditionalLine item = new UguiNovelTextGeneratorAdditionalLine(this, num2, count, generator);
                        list.Add(item);
                        item.InitTextLine(generator);
                        if (!item.characteData.TrySetCharacterInfo(generator.NovelText.get_font()))
                        {
                            Debug.LogError("Line Font Missing");
                        }
                    }
                }
            }
            if (index < (this.stringData.Count - 1))
            {
                this.stringData.RemoveRange(index, this.stringData.Count - index);
            }
            return(list);
        }