예제 #1
0
    private GameObject BuildChar(string character, RectTransform prev)
    {
        int index  = gameObjects.Count;
        var result = chatter.Contais(index);

        GameObject gameObject    = BuildChar(character);
        var        parentSize    = gameObject.transform.parent.GetComponent <RectTransform>().sizeDelta;
        var        rectTransform = gameObject.GetComponent <RectTransform>();
        float      nextX         = prev.anchoredPosition.x + RealSize.x;
        float      X             = nextX < parentSize.x / 2 ? (result.Key ? prev.anchoredPosition.x : nextX) : rectTransform.anchoredPosition.x;
        float      Y             = nextX < parentSize.x / 2 ? prev.anchoredPosition.y : prev.anchoredPosition.y - RealSize.y;

        rectTransform.anchoredPosition = new Vector2(X, Y);
        return(gameObject);
    }
예제 #2
0
 void PrintChar()
 {
     if (c < text.Length)
     {
         do
         {
             textController.text += text[c];
             c++;
         } while (current.Contais(c).Key);
     }
 }